Challenge Overview
Project Overview
We have built two separate apps for the client: My Media (PCDVR) and Media Share (Min Config).
- ���My Media is an app that allows users to store their media files (photos / videos / etc...) to the cloud
- Media Share is an app that allows users to share their media files (photos / videos / etc..) to a device like TV so that others can see the shared media
Please register to see more details on how the apps work in the forum.
Competition Task Overview
For this challenge, we'd like to implement some basic integration between the two apps, and we'll only worry about photos in this challenge.
- The user will visit the Media Share page with AuthGuid as a URL parameter, the Media Share app needs to keep track of this parameter for each session
- Whenever a photo is uploaded to the Media Share, it needs to save the photo to My Media using the AuthGuid passed as a parameter, which involes an OAuth call and a series of RESTFul calls as detailed below:
- ������Perform OAuth call, we did this in java before this time we need to do the same in Node.js. Here's how we did it in java:
- ���Include AuthGuid as a URL parameter
- OAuthConsumer consumer = new CommonsHttpOAuthConsumer(serviceKey,serviceSecret); // we'll provide key and secret in forum
- consumer.sign(request);
- Check for the existence of a "SharedMedia" folder in the account:
- The call will be something like this: ���https://secure.api.comcast.net/ugc-qa1/albums?authguid=12345
- This call will return JSON listing the albums for the user, iterate through them to see if "SharedMedia" exists
- If the folder doesn't exist, create it
- ���The call will be something like this: https://secure.api.comcast.net/ugc-qa1/albums?authguid=12345&name=SharedMedia
- The call will return JSON which will include the albumguid you'll need
- Get a url with which to upload the actual file
- ���The call will be something like this: https://secure.api.comcast.net/ugc-qa1/files?authguid=12345&albumguid=fromstep2&filename=afilename
- authguid is the AuthGuid passed from My Media
- albumguid is from the above step
- filename is the name of the file to be uploaded. We can create it as the date/time of the upload, for example: 2014-05-21-15-43-31.png
- This call will return JSON which will include the fileguid that you'll need
- Upload the file to the account
- ���The call will be something like this: https://secure.api.comcast.net/ugc-qa1/files/fileguid?authguid=12345
- authguid is the AuthGuid passed from My Media
- fileguid is from the above step
- At the end of the calls we should display a result message which says either "Your file was saved!" or "There was a problem saving your file."
- The RESTFul calls are detailed here: http://162.150.10.54:8080/ugc-api-docs/
- We'll provide the list of AuthGuids you can use in challenge forum.
- ������Perform OAuth call, we did this in java before this time we need to do the same in Node.js. Here's how we did it in java:
- Notes
- ������We do not need resumable uploads at this time
- You can check the Android / iOS code we attached in the forum to see how upload was done in the apps
Verify Upload Result
In order to verify if upload succeeds, you'll need to use the My Media Apps (either Android or iOS) and login with corresponding accounts to see if the photo is there.
We'll provide the mapping from AuthGuids to the accounts in the challenge forum.
Security
Do not put OAuth details / credentials as plain text in Javascript code, instead we should try to keep this encrypted and/or invisible from users of the web pages so they won't be able to use these and modify other's data.
Errors
Please produce meaningful logs for errors, especially errors during upload so we can easily see what's wrong when upload fails.
Testing
You need to provide manual demos to verify your implementation.
Technology Overview
- NodeJs
- OAuth
- Javascript
- RESTFul
Documentation Provided
Register to download documents from challenge forum.
Final Submission Guidelines
Submission Deliverables
A complete list of deliverables can be viewed in the TopCoder Assembly competition Tutorial at: http://apps.topcoder.com/wiki/display/tc/Assembly+Competition+Tutorials
Below is an overview of the deliverables:
- Updated Media Share (Min Config) server code that handles saving of photos to My Media (PCDVR)
- A complete and detailed deployment documented explaining how to deploy the application including configuration information.
Final Submission
For each member, the final submission should be uploaded to the Online Review Tool.