Skip to content

Instantly share code, notes, and snippets.

@phpfour
Created April 10, 2012 06:43
Show Gist options
  • Save phpfour/2348852 to your computer and use it in GitHub Desktop.
Save phpfour/2348852 to your computer and use it in GitHub Desktop.
Twitter JSONP example
<script type="text/javascript">
jQuery(document).ready(function($){
$.ajax({
url:'http://search.twitter.com/search.json?q=<?php echo urlencode('#toyota #camry') ?>&rpp=8&callback=?',
dataType:'jsonp',
success:function (data) {
for (key in data['results']) {
var tweet = data['results'][key]['text'];
var from = data['results'][key]['from_user'];
var create = data['results'][key]['created_at'];
}
}
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment