Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1.4.2: Fixed limit bug

  • Loading branch information...
commit eb95518bae4e51f8afcffbdf2f4b346796692d2e 1 parent 4dee18f
@elektronaut elektronaut authored
View
4 README.rdoc
@@ -64,6 +64,10 @@ If you want to apply behavior when new tweets are loaded, you can pass a callbac
== Changelog
+=== 1.4.2
+
+* Fixed issue with higher limits than Twitter returns by default (thanks to Paul from Zerofee!)
+
=== 1.4.1
* Fixed broken parsing of timestamps in IE in user_timeline mode (thanks to Matt Adams!)
View
5 jquery.livetwitter.js
@@ -1,11 +1,11 @@
/*
- * jQuery LiveTwitter 1.4.1
+ * jQuery LiveTwitter 1.4.2
* - Live updating Twitter plugin for jQuery
*
* Copyright (c) 2009-2010 Inge Jørgensen (elektronaut.no)
* Licensed under the MIT license (MIT-LICENSE.txt)
*
- * $Date: 2010/01/07$
+ * $Date: 2010/04/23$
*/
/*
@@ -116,6 +116,7 @@
if(this.settings.lang){
params.lang = this.settings.lang;
}
+ params.rpp = this.settings.limit;
// Convert params to string
var paramsString = [];
View
2  jquery.livetwitter.min.js
@@ -1 +1 @@
-(function(a){if(!a.fn.reverse){a.fn.reverse=function(){return this.pushStack(this.get().reverse(),arguments)}}a.fn.liveTwitter=function(d,b,e){var c=this;a(this).each(function(){var f={};if(this.twitter){f=jQuery.extend(this.twitter.settings,b);this.twitter.settings=f;if(d){this.twitter.query=d}this.twitter.limit=f.limit;this.twitter.mode=f.mode;if(this.twitter.interval){this.twitter.refresh()}if(e){this.twitter.callback=e}}else{f=jQuery.extend({mode:"search",rate:15000,limit:10,refresh:true},b);if(typeof f.showAuthor=="undefined"){f.showAuthor=(f.mode=="search")?true:false}if(!window.twitter_callback){window.twitter_callback=function(){return true}}this.twitter={settings:f,query:d,limit:f.limit,mode:f.mode,interval:false,container:this,lastTimeStamp:0,callback:e,relativeTime:function(i){var h=Date.parse(i);var k=(Date.parse(Date())-h)/1000;var j="";if(k<60){j=k+" seconds ago"}else{if(k<120){j="a minute ago"}else{if(k<(45*60)){j=(parseInt(k/60,10)).toString()+" minutes ago"}else{if(k<(90*60)){j="an hour ago"}else{if(k<(24*60*60)){j=""+(parseInt(k/3600,10)).toString()+" hours ago"}else{if(k<(48*60*60)){j="a day ago"}else{j=(parseInt(k/86400,10)).toString()+" days ago"}}}}}}return j},refreshTime:function(){var h=this;a(h.container).find("span.time").each(function(){a(this).html(h.relativeTime(this.timeStamp))})},refresh:function(h){var j=this;if(this.settings.refresh||h){var i="";var m={};if(j.mode=="search"){m.q=this.query;if(this.settings.geocode){m.geocode=this.settings.geocode}if(this.settings.lang){m.lang=this.settings.lang}var k=[];for(var l in m){if(m.hasOwnProperty(l)){k[k.length]=l+"="+encodeURIComponent(m[l])}}k=k.join("&");i="http://search.twitter.com/search.json?"+k+"&callback=?"}else{if(j.mode=="user_timeline"){i="http://twitter.com/statuses/user_timeline/"+encodeURIComponent(this.query)+".json?count="+j.limit+"&callback=?"}}a.getJSON(i,function(o){var n=null;if(j.mode=="search"){n=o.results}else{n=o}var p=0;a(n).reverse().each(function(){var u="";var s="";if(j.mode=="search"){u=this.from_user;s=this.profile_image_url;created_at_date=this.created_at}else{u=this.user.screen_name;s=this.user.profile_image_url;created_at_date=this.created_at.replace(/^(\w+)\s(\w+)\s(\d+)(.*)(\s\d+)$/,"$1, $3 $2$5$4")}var q=this.user;var t=this.text.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/,function(w){return w.link(w)});t=t.replace(/@[A-Za-z0-9_]+/,function(w){return w.link("http://twitter.com/"+w.replace(/^@/,""))});if(Date.parse(created_at_date)>j.lastTimeStamp){p+=1;var v='<div class="tweet tweet-'+this.id+'">';if(j.settings.showAuthor){v+='<img width="24" height="24" src="'+s+'" /><p class="text"><span class="username"><a href="http://twitter.com/'+u+'">'+u+"</a>:</span> "}else{v+='<p class="text"> '}v+=t+' <span class="time">'+j.relativeTime(created_at_date)+"</span></p></div>";a(j.container).prepend(v);var r=created_at_date;a(j.container).find("span.time:first").each(function(){this.timeStamp=r});if(!h){a(j.container).find(".tweet-"+this.id).hide().fadeIn()}j.lastTimeStamp=Date.parse(created_at_date)}});if(p>0){a(j.container).find("div.tweet:gt("+(j.limit-1)+")").remove();if(j.callback){j.callback(c,p)}a(c).trigger("tweets")}})}},start:function(){var h=this;if(!this.interval){this.interval=setInterval(function(){h.refresh()},h.settings.rate);this.refresh(true)}},stop:function(){if(this.interval){clearInterval(this.interval);this.interval=false}}};var g=this.twitter;this.timeInterval=setInterval(function(){g.refreshTime()},5000);this.twitter.start()}});return this}})(jQuery);
+(function(a){if(!a.fn.reverse){a.fn.reverse=function(){return this.pushStack(this.get().reverse(),arguments)}}a.fn.liveTwitter=function(d,b,e){var c=this;a(this).each(function(){var f={};if(this.twitter){f=jQuery.extend(this.twitter.settings,b);this.twitter.settings=f;if(d){this.twitter.query=d}this.twitter.limit=f.limit;this.twitter.mode=f.mode;if(this.twitter.interval){this.twitter.refresh()}if(e){this.twitter.callback=e}}else{f=jQuery.extend({mode:"search",rate:15000,limit:10,refresh:true},b);if(typeof f.showAuthor=="undefined"){f.showAuthor=(f.mode=="search")?true:false}if(!window.twitter_callback){window.twitter_callback=function(){return true}}this.twitter={settings:f,query:d,limit:f.limit,mode:f.mode,interval:false,container:this,lastTimeStamp:0,callback:e,relativeTime:function(i){var h=Date.parse(i);var k=(Date.parse(Date())-h)/1000;var j="";if(k<60){j=k+" seconds ago"}else{if(k<120){j="a minute ago"}else{if(k<(45*60)){j=(parseInt(k/60,10)).toString()+" minutes ago"}else{if(k<(90*60)){j="an hour ago"}else{if(k<(24*60*60)){j=""+(parseInt(k/3600,10)).toString()+" hours ago"}else{if(k<(48*60*60)){j="a day ago"}else{j=(parseInt(k/86400,10)).toString()+" days ago"}}}}}}return j},refreshTime:function(){var h=this;a(h.container).find("span.time").each(function(){a(this).html(h.relativeTime(this.timeStamp))})},refresh:function(h){var j=this;if(this.settings.refresh||h){var i="";var m={};if(j.mode=="search"){m.q=this.query;if(this.settings.geocode){m.geocode=this.settings.geocode}if(this.settings.lang){m.lang=this.settings.lang}m.rpp=this.settings.limit;var k=[];for(var l in m){if(m.hasOwnProperty(l)){k[k.length]=l+"="+encodeURIComponent(m[l])}}k=k.join("&");i="http://search.twitter.com/search.json?"+k+"&callback=?"}else{if(j.mode=="user_timeline"){i="http://twitter.com/statuses/user_timeline/"+encodeURIComponent(this.query)+".json?count="+j.limit+"&callback=?"}}a.getJSON(i,function(o){var n=null;if(j.mode=="search"){n=o.results}else{n=o}var p=0;a(n).reverse().each(function(){var u="";var s="";if(j.mode=="search"){u=this.from_user;s=this.profile_image_url;created_at_date=this.created_at}else{u=this.user.screen_name;s=this.user.profile_image_url;created_at_date=this.created_at.replace(/^(\w+)\s(\w+)\s(\d+)(.*)(\s\d+)$/,"$1, $3 $2$5$4")}var q=this.user;var t=this.text.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/,function(w){return w.link(w)});t=t.replace(/@[A-Za-z0-9_]+/,function(w){return w.link("http://twitter.com/"+w.replace(/^@/,""))});if(Date.parse(created_at_date)>j.lastTimeStamp){p+=1;var v='<div class="tweet tweet-'+this.id+'">';if(j.settings.showAuthor){v+='<img width="24" height="24" src="'+s+'" /><p class="text"><span class="username"><a href="http://twitter.com/'+u+'">'+u+"</a>:</span> "}else{v+='<p class="text"> '}v+=t+' <span class="time">'+j.relativeTime(created_at_date)+"</span></p></div>";a(j.container).prepend(v);var r=created_at_date;a(j.container).find("span.time:first").each(function(){this.timeStamp=r});if(!h){a(j.container).find(".tweet-"+this.id).hide().fadeIn()}j.lastTimeStamp=Date.parse(created_at_date)}});if(p>0){a(j.container).find("div.tweet:gt("+(j.limit-1)+")").remove();if(j.callback){j.callback(c,p)}a(c).trigger("tweets")}})}},start:function(){var h=this;if(!this.interval){this.interval=setInterval(function(){h.refresh()},h.settings.rate);this.refresh(true)}},stop:function(){if(this.interval){clearInterval(this.interval);this.interval=false}}};var g=this.twitter;this.timeInterval=setInterval(function(){g.refreshTime()},5000);this.twitter.start()}});return this}})(jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.