-
-
Save pilate/768298 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
function fetchAndPrintPosts(id,num,tag) | |
{ | |
// Read data from Tumblr, this creates the variable tumblr_api_read. | |
jQuery.ajax({ | |
url : "http://staff.tumblr.com/api/read/json?num=" + num + "&filter=text&tagged=" + tag, | |
dataType : "jsonp", | |
success : function(test) { | |
//printPosts(id); | |
console.log(test); | |
} | |
}); | |
} | |
function printPosts(id) | |
{ | |
//var element_to_append_to = document.getElementById(id); | |
//var posts = tumblr_api_read["posts"]; | |
} | |
fetchAndPrintPosts('latest_events',50,'events'); | |
fetchAndPrintPosts('latest_press',50,'press'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment