PageSourceSearch

https://creactivity.ro/js/jquery.tweetable.js

js creactivity.ro collected 2026-10-04 21:46:30 UTC 2,064 bytes, 48 lines download raw bytes

1/*
2 * tweetable 1.3 - jQuery twitter feed generator plugin
3 *
4 * Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/)
5 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 
6 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
7 *
8 * Revision: $Id: jquery.tweetable.js 2010-08-09 $ 
9 *
10 */
11(function($){
12		$.fn.tweetable=function(options){
13			var defaults={
14				id:'recent-side',
15				limit:5,
16				username:'philipbeel',
17				time:false,
18				symbol_time: '@',
19				replies:false
20			};
21			var options=$.extend(defaults,options);
22			return this.each(function(options){
23				var act=$(this);
24				var api="http://api.twitter.com/1/statuses/user_timeline.json?screen_name=";
25				var count="&count=";
26				$.getJSON(api+defaults.username+count+defaults.limit+"&callback=?",act,function(data){
27					$.each(data,function(i,item){
28						if(i==0){
29							$(act).prepend('<ul id="recent-tweets" class="'+defaults.id+'">');
30						}
31						if(defaults.replies === false) {
32							if(item.in_reply_to_status_id === null){
33								$('.'+defaults.id+'').append('<li class="tweet_content_'+i+'">'+item.text.replace(/#(.*?)(\s|$)/g,'#$1').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,'<a href="$&">$&</a> ').replace(/@(.*?)(\s|\(|\)|$)/g,'<a href="http://twitter.com/$1">@$1 </a>$2'));
34								if(defaults.time==true){
35									$('.tweet_content_'+i).append('<p class="meta"> '+item.created_at.substr(0,20)+'</p></li>');
36								}								
37							}							
38						} else {
39							$('.'+defaults.id+'').append('<li class="tweet_content_'+i+'">'+item.text.replace(/#(.*?)(\s|$)/g,'#$1').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,'<a href="$&">$&</a> ').replace(/@(.*?)(\s|\(|\)|$)/g,'<a href="http://twitter.com/$1">@$1 </a>$2'));
40							if(defaults.time==true){
41								$('.tweet_content_'+i).append('<p class="meta">'+defaults.symbol_time+' '+item.created_at.substr(0,20)+'</p></li>');
42							}								
43						}
44					});
45				});
46			});
47		}
48	})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.