forked from uzbekjon/jTwitter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjquery.jtwitter.min.js
11 lines (11 loc) · 1.04 KB
/
jquery.jtwitter.min.js
1
2
3
4
5
6
7
8
9
10
11
/*
* jTwitter 1.1.2 - Twitter API abstraction plugin for jQuery
* Copyright (c) 2009 jQuery Howto
* Copyright (c) 2010 Electric Pulp
* Licensed under the GPL license:
* http://www.gnu.org/licenses/gpl.html
* Plugin + Author URL:
* http://jquery-howto.blogspot.com
* http://electricpulp.com/
*/
(function($){$.extend({jTwitter:function(username,numPosts,fnk){var info={};if(username=='undefined'||numPosts=='undefined'){return}else if($.isFunction(numPosts)){fnk=numPosts;numPosts=5}var url="http://twitter.com/status/user_timeline/"+username+".json?count="+numPosts+"&callback=?";$.getJSON(url,function(data){if($.isFunction(fnk)){fnk.call(this,data)}})}});$.extend({jTwitterSearch:function(query,numPosts,fnk){var info={};if(query=='undefined'||numPosts=='undefined'){return}else if($.isFunction(numPosts)){fnk=numPosts;numPosts=5}if(!query.match(/^q=/))query='q='+query;var url="http://search.twitter.com/search.json?&"+query+"&rpp="+numPosts+"&callback=?";$.getJSON(url,function(data){if($.isFunction(fnk)){fnk.call(this,data)}})}})})(jQuery);