Skip to content
Extraits de code Groupes Projets
Valider 63a481a1 rédigé par Aaron Parecki's avatar Aaron Parecki Validation de GitHub
Parcourir les fichiers

Create foursquare.html

parent 541fe1d4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<html>
<head>
<title>Example App</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
<div id="login">
<a href="https://foursquare.com/oauth2/authenticate?client_id=IFMKONPESAZI2NG3D2QWFTJISPVEITNB2IEKTZ0WVLGZKEFI&response_type=token&redirect_uri=http://oauth2.dev/code/foursquare.html">Log In</a>
</div>
<div id="signed-in" style="display: none;">
<h2 id="header">Your last 10 checkins</h2>
<div id="checkins">
</div>
</div>
<script>
$(function(){
var token;
if(window.location.hash
&& (token=window.location.hash.match("access_token=([^&]+)")[1])) {
$("#login").hide();
var checkins_url = "https://api.foursquare.com/v2/users/self/checkins"
+ "?v=20150201&limit=10&oauth_token="+token;
$.getJSON(checkins_url, function(data){
var checkins = data.response.checkins.items;
var html = '';
$(checkins).each(function(i,c){
html += '<a href="https://foursquare.com/_/checkin/' + c.id + '">'
+ c.venue.name + '</a><br>';
});
$("#checkins").html(html);
$("#signed-in").show();
});
}
});
</script>
</body>
</html>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter