Permalink
Browse files

Added Rotten Tomatoes App

  • Loading branch information...
Amit Jotwani
Amit Jotwani committed Oct 18, 2011
1 parent d96b95e commit d5e50eb2ae6313baa12c9019cd969f583fefa30f
Showing with 2,721 additions and 0 deletions.
  1. +89 −0 mashery.rottentomatoes/3.4.0/Readme.md
  2. +186 −0 mashery.rottentomatoes/3.4.0/_appMobi/xhr.js
  3. +860 −0 mashery.rottentomatoes/3.4.0/aUX_ui.css
  4. +50 −0 mashery.rottentomatoes/3.4.0/aUX_ui.min.js
  5. +55 −0 mashery.rottentomatoes/3.4.0/aUX_web.all.min.js
  6. BIN mashery.rottentomatoes/3.4.0/images/ajax-loader.png
  7. BIN mashery.rottentomatoes/3.4.0/images/background.jpg
  8. BIN mashery.rottentomatoes/3.4.0/images/food.png
  9. BIN mashery.rottentomatoes/3.4.0/images/greenspace.png
  10. BIN mashery.rottentomatoes/3.4.0/images/icons-18-white.png
  11. BIN mashery.rottentomatoes/3.4.0/images/listArrow.png
  12. BIN mashery.rottentomatoes/3.4.0/images/listArrowSel.png
  13. BIN mashery.rottentomatoes/3.4.0/images/listGroup.png
  14. BIN mashery.rottentomatoes/3.4.0/images/lodging.png
  15. BIN mashery.rottentomatoes/3.4.0/images/masherymade.png
  16. BIN mashery.rottentomatoes/3.4.0/images/paw.png
  17. BIN mashery.rottentomatoes/3.4.0/images/project_icon.png
  18. BIN mashery.rottentomatoes/3.4.0/images/refresh.png
  19. BIN mashery.rottentomatoes/3.4.0/images/rotten.png
  20. BIN mashery.rottentomatoes/3.4.0/images/vet.png
  21. +80 −0 mashery.rottentomatoes/3.4.0/index.html
  22. +102 −0 mashery.rottentomatoes/3.4.0/rottentomatoes.js
  23. +97 −0 mashery.rottentomatoes/3.4.0/style.css
  24. +338 −0 mashery.rottentomatoes/3.4.0/web/aUX_webCarousel.js
  25. +103 −0 mashery.rottentomatoes/3.4.0/web/aUX_webCss3animate.js
  26. +111 −0 mashery.rottentomatoes/3.4.0/web/aUX_webPasswordBox.js
  27. +439 −0 mashery.rottentomatoes/3.4.0/web/aUX_webScroll.js
  28. +1 −0 mashery.rottentomatoes/3.4.0/web/aUX_webSelectBox.js
  29. +55 −0 mashery.rottentomatoes/3.4.0/web/aUX_webShake.js
  30. +122 −0 mashery.rottentomatoes/3.4.0/web/aUX_webSwipe.js
  31. +33 −0 mashery.rottentomatoes/3.4.0/web/aUX_webTemplate.js
@@ -0,0 +1,89 @@
+ROTTEN TOMATOES API DEMO APP
+==================================================================
+Created lovingly for the developer community by Mashery.
+
+http://www.mashery.com
+
+http://developer.mashery.com
+
+
+SYNOPSIS
+==================================================================
+This demo App provides a way to see the Rotten Tomatoes API in action.
+It's built using appMobi's Cross Platform Development Kit (XDK)
+that lets you create mobile apps for smartphones and tablets using
+standard web languages (HTML5, CSS, and JavaScript).
+
+
+
+FEATURES
+==================================================================
+1. Uses Rotten Tomatoes's API to query hundreds of millions of social web profiles.
+2. Search by Twitter Username
+3. Search by Facebook Username
+4. Search by Email address
+
+
+
+GETTING STARTED
+==================================================================
+You will need the following to get started -
+
+1. appMobi's XDK - free download at http://www.appmobi.com/?q=node/27
+2. A Rotten Tomatoes API key - register at http://developer.rottentomatoes.com/member/register
+
+
+
+OBTAINING THE API KEY
+==================================================================
+Before you can begin using this app, you will need to get an API
+key from Rotten Tomatoes at http://developer.rottentomatoes.com/member/register. This
+will also give you a Single Sign-On Mashery ID with access to hundreds
+of other APIs.
+
+
+SETTING UP THE API KEY IN THIS APP
+==================================================================
+Once you have obtained your API key, assign the API key to the
+variable api_key on line 1 of the file RottenTomatoes.js, like so -
+
+<pre>
+ var api_key ='your_api_key_here';
+</pre>
+
+ABOUT THE ROTTEN TOMATOES API
+==================================================================
+Rotten Tomatoes lets you mine the public web for information about your
+customers, users or leads. Query hundreds of millions of social
+web profiles by email, Twitter username or Facebook ID. Supports
+results from over 125 social networks. Learn more about the
+Rotten Tomatoes API at http://developer.rottentomatoes.com
+
+
+ROTTEN TOMATOES API DOCUMENTATION
+==================================================================
+To learn more about the data set provided by Rotten Tomatoes's API, you can
+read through the API documentation at http://developer.rottentomatoes.com/docs
+or use their interactive documentation at http://developer.rottentomatoes.com/iodocs
+
+
+ABOUT THE MASHERY API NETWORK
+==================================================================
+The Mashery API Network (http://developer.mashery.com) is an open
+data commons of over 50 RESTful APIs that developers can access
+with their Mashery ID.
+
+Mashery is the world's leading API management service provider, helping
+companies provide the best API experience for developers, as well as
+the most advanced API management and reporting tools to our clients.
+
+
+EXPLORE MORE APIS
+==================================================================
+Check out Mashery's API Network at http://developer.mashery.com/apis
+to explore other awesome APIs including NY Times, Klout, USA TODAY, Best Buy, Hoovers, Edmunds, Netflix, Rdio and many more.
+
+
+SUPPORT
+==================================================================
+If you have any questions or need any help obtaining an API key, you can reach out to us at: developer-relations@mashery.com
@@ -0,0 +1,186 @@
+/* xhr.js
+ * This overrides the XMLHTTPRequest object to allow cross domain ajax requests
+ */
+(function () {
+ document.addEventListener("appMobi.device.remote.data", getRemoteExtCB, false);
+ var ajaxCallbacks = [];
+
+ function getRemoteExtCB(obj) {
+ if (ajaxCallbacks.length > 0 && ajaxCallbacks[obj.id]) {
+ ajaxCallbacks[obj.id](obj);
+ }
+ }
+
+ XMLHttpRequest_Native = XMLHttpRequest;
+ XMLHttpRequest.Extension = new Object;
+
+ XMLHttpRequest.Extension.addObject = function (object) {
+ uniqueId = Math.floor(Math.random() * 99999999);
+ object.uniqueId = uniqueId;
+ this[uniqueId] = object;
+ return uniqueId;
+ }
+
+ XMLHttpRequest.Extension.sendXMLHTTP = function (data) {
+ var myparams = new AppMobi.Device.RemoteDataParameters();
+ for (var j in data.headers) {
+ myparams.addHeader(j, data.headers[j]);
+ }
+
+ myparams.url = data.requestData.URL;
+ myparams.id = data.uniqueId;
+ myparams.method = data.requestData.method
+ myparams.body = data.body;
+ try{
+ if(typeof myparams.body=="object"){
+ myparams.body=JSON.stringify(myparams.body);
+ }
+ ajaxCallbacks[myparams.id] = this.handleResponseData;
+ AppMobi.device.getRemoteDataExt(myparams);
+ }
+ catch(e){}
+ }
+
+ XMLHttpRequest.Extension.handleResponseData = function (object) {
+
+ var XMLObj = XMLHttpRequest.Extension[object.id];
+ //EMULATED "HEADERS RECEIVED" CHANGES
+ var newHeaders = [];
+ for (var j in object.extras.headers) {
+ newHeaders[j.toLowerCase()] = object.extras.headers[j]; //jQuery looks for lowercase
+ newHeaders[j] = object.extras.headers[j];
+ }
+ XMLObj.responseData.headers = newHeaders;
+ XMLObj.readyState = XMLObj.HEADERS_RECEIVED;
+ if (typeof XMLObj.onreadystatechange == 'function') XMLObj.onreadystatechange();
+
+ XMLObj.readyState = XMLObj.LOADING;
+ if (typeof XMLObj.onreadystatechange == 'function') XMLObj.onreadystatechange();
+
+ XMLObj.response = object.response;
+ XMLObj.status = object.extras.status;
+ XMLObj.responseText = object.response;
+ XMLObj.responseXML = object.response;
+ XMLObj.readyState = XMLObj.DONE;
+
+ if (typeof XMLObj.onreadystatechange == 'function') XMLObj.onreadystatechange();
+ }
+
+
+ // XMLHTTP REDEFINE
+ //=======================================================================================================================
+ //DEFINE "CONSTANTS" FOR CONSTRUCTOR
+ XMLHttpRequest.UNSENT = 0; //const
+ XMLHttpRequest.OPENED = 1; //const
+ XMLHttpRequest.HEADERS_RECEIVED = 2; //const
+ XMLHttpRequest.LOADING = 3; //const
+ XMLHttpRequest.DONE = 4; //const
+
+ //DEFINE "CONSTANTS" PROTOTYPE
+ XMLHttpRequest.prototype.UNSENT = 0; //const
+ XMLHttpRequest.prototype.OPENED = 1; //const
+ XMLHttpRequest.prototype.HEADERS_RECEIVED = 2; //const
+ XMLHttpRequest.prototype.LOADING = 3; //const
+ XMLHttpRequest.prototype.DONE = 4; //const
+ //XMLHttpRequest = {readyState:0 };
+ XMLHttpRequest.prototype.open;
+ XMLHttpRequest.prototype.readyState = 0;
+ XMLHttpRequest.prototype.onreadystatechange;
+ XMLHttpRequest.prototype.headers = {};
+ XMLHttpRequest.prototype.body = "";
+
+
+
+ XMLHttpRequest.prototype.requestData = {
+ 'method': null,
+ 'URL': null,
+ 'asynchronous': true,
+ 'username': null,
+ 'password': null,
+ 'headers': null
+ };
+ XMLHttpRequest.prototype.responseData = {
+ 'headers': null
+ };
+
+
+ XMLHttpRequest.prototype.abort = function abort() {};
+ XMLHttpRequest.prototype.addEventListener = function addEventListener() {};
+ XMLHttpRequest.prototype.constructor = function XMLHttpRequest() {};
+ XMLHttpRequest.prototype.dispatchEvent = function dispatchEvent() {};
+
+ XMLHttpRequest.prototype.getAllResponseHeaders = function getAllResponseHeaders() {
+ if (this.readyState == this.OPENED || this.readyState == this.UNSENT) return "";
+ else {
+ return this.responseData.headers;
+ }
+ };
+
+ XMLHttpRequest.prototype.getResponseHeader = function getResponseHeader(header) {
+ return this.responseData.headers && this.responseData.headers[header] ? this.responseData.headers[header] : "";
+ };
+
+ XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
+ //supported methods: CONNECT, DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE, or TRACK
+ /* Empty the list of author request headers.
+ Set the request method to method.
+ Set the request URL to url.
+ Set the request username to temp user.
+ Set the request password to temp password.
+ Set the asynchronous flag to the value of async.
+ */
+ this.requestData.method = method;
+ this.requestData.URL = url;
+ this.requestData.asynchronous = async;
+ this.requestData.user = user;
+ this.requestData.password = password;
+ this.readyState = this.OPENED;
+ if (typeof this.onreadystatechange == 'function') this.onreadystatechange();
+
+ }
+
+ XMLHttpRequest.prototype.overrideMimeType = function overrideMimeType() {};
+ XMLHttpRequest.prototype.removeEventListener = function removeEventListener() {};
+
+ XMLHttpRequest.prototype.send = function send(data) {
+ this.body = data;
+ if(this.requestData.asynchronous===false)
+ {
+ throw ("Synchronous XMLHtppRequest calls are not allowed. Please change your request to be asynchronous");
+ return;
+ }
+ XMLHttpRequest.Extension.sendXMLHTTP(this);
+ };
+
+ XMLHttpRequest.prototype.setRequestHeader = function setRequestHeader(header, value) {
+ this.headers[header] = value;
+ };
+
+
+ function XMLHttpRequest() {
+ XMLHttpRequest.Extension.addObject(this);
+ this.onabort = null;
+ this.onerror = null;
+ this.onload = null;
+ this.onloadstart = null;
+ this.onprogress = null;
+ this.onreadystatechange = null;
+ this.readyState = 0;
+ this.response = "";
+ this.responseText = "";
+ this.responseType = "";
+ this.responseXML = null;
+ this.status = 0;
+ this.statusText = "";
+ this.withCredentials = false;
+ this.requestData = {
+ 'method': null,
+ 'URL': null,
+ 'asynchronous': null,
+ 'username': null,
+ 'password': null,
+ 'headers': null
+ };
+ }
+ window.XMLHttpRequest = XMLHttpRequest;
+})();
Oops, something went wrong.

0 comments on commit d5e50eb

Please sign in to comment.