Skip to content

Instantly share code, notes, and snippets.

@pilate
Forked from seanh/gist:768283
Created January 6, 2011 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pilate/768298 to your computer and use it in GitHub Desktop.
Save pilate/768298 to your computer and use it in GitHub Desktop.
<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