public
Last active — forked from seanh/gist:768283

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
<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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.