Skip to content
Browse files

removed my key, changed my key on foursquare... gotta stop committing…

… my key (and tweaked readme)
  • Loading branch information...
1 parent 1f8d306 commit 5738d68be95e2d9bf641145509c9cb2c2cc48040 @quickredfox quickredfox committed Feb 16, 2011
Showing with 38 additions and 6 deletions.
  1. +37 −5 README.md
  2. +1 −1 examples/login/index.html
View
42 README.md
@@ -33,12 +33,44 @@ Fiddle
- [(possibly outdated and broken) Js Fiddle example](http://fiddle.jshell.net/quickredfox/kBrhM/15/show)
+QuickExample
+--------------------------------------------------------------------------------------------------------
+
+
+ // Supply your foursquare client id
+ var FSQUARE_CLIENT_ID = 'FOURSQUARE_CLIENT_ID';
+ // on DOM ready...
+ $(function() {
+ // setup with your key and a callback function which
+ // receives the Marelle Object ( "M" in this example )
+ $.Marelle( FSQUARE_CLIENT_ID ).done( function( M ){
+ // grab an authentication promise
+ var authpromise = M.authenticateVisitor();
+ // handle logged-in user
+ var authsuccess = function(user){
+ M.signoutButton( document.body );
+ console.log(user)
+ };
+ // handle non user
+ var authfailure = function() {
+ M.signinButton( document.body );
+ };
+ // wait for promise to resolve
+ authpromise.then(authsuccess,authfailure)
+
+ }).fail(function(){
+ consoloe.log('Marelle could not be loaded.')
+ });
+ });
+
+
*****
Marelle API v0.2
============================================================================================================
-Note: Lotsa lotsa changes, mainly though events have been removed, use promises instead.
+Note: Lotsa lotsa changes! Mainly though: events and support for conventional ajax callbacks have been removed,
+use promises instead.
Methods
============================================================================================================
@@ -90,10 +122,10 @@ Modeled Objects
Every time an AJAX request is made to the FourSquare API through Marelle,
the returned JSON object gets decorated using a JSON representation of
the FourSquare API documentation augmented with some fetcher methods during
-Marelle's internal initialization. This means that all these methods resolve
-to the original FourSquare API response structure with "meta" and "response"
-as the first level attributes. Marelle also decorates parent objects with
-a {attribute}Count variable whenever it encounters a collection of items
+Marelle's internal initialization. This means that all these methods promise
+to resolve as the original FourSquare API response structure with "meta" and
+"response" as the first level attributes. Marelle also decorates parent objects
+with an {attribute}Count variable whenever it encounters a collection of items
when recognizably structured so by the foursquare API.
$.Marelle.User(json)
View
2 examples/login/index.html
@@ -15,7 +15,7 @@
<body>
<script type="text/javascript" charset="utf-8">
// Supply your foursquare client id
- var FSQUARE_CLIENT_ID = 'CQNYUACMANEXA124BE5ANZ3FJMDZX2ITACMODYWAWFD10FIM';
+ var FSQUARE_CLIENT_ID = 'FOURSQUARE_CLIENT_ID';
// on DOM ready...
$(function() {
// setup with your key and a callback function which

0 comments on commit 5738d68

Please sign in to comment.
Something went wrong with that request. Please try again.