/* * tweetable 2.0 - jQuery twitter feed plugin * * Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/) * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. * * With modifications from Philipp Robbel (http://www.robbel.com/) & Patrick DW (stackoverflow) * * Revision: $Id: jquery.tweetable.js 2013-06-16 $ * */ (function($) { jQuery.fn.tweetable = function (opts) { opts = $.extend({}, $.fn.tweetable.options, opts); return this.each(function () { var act = jQuery(this) , tweetList = jQuery('
'+ opts.loading +'
'); // Fire JSON request to twitter API jQuery.getJSON(api + opts.username + limitcount + opts.limit).done(function(data) { // Hide the tweet loader in favour of the response jQuery("#tweet_loader").remove(); // Check for response error twitterError = data && data.error || null; if(twitterError) { tweetList.append(''+ opts.failed +'
' + tweet.response.replace(/#(.*?)(\s|$)/g, '#$1 ').replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, '$& ').replace(/@(.*?)(\s|\(|\)|$)/g, '@$1 $2').replace(/:">/, ' ">').replace(/: <\/a>/, ':') + '
'+ opts.failed +'