Changeset 65

User picture

Author: frojo56

(2009/02/17 15:23) Almost 3 years ago

Pushed to userscripts.org

Affected files

Updated twitter_fantastico.user.js Download diff

6465
10
// ==/UserScript==
10
// ==/UserScript==
11
11
12
//TODO: Eliminate the website from asking for login credentials twice. Unnecessary!
12
//TODO: Eliminate the website from asking for login credentials twice. Unnecessary!
13
//TODO: AJAX posting of regular update.
14
//TODO: Set focus on textareas when shown via a reply or retweet. (Bug is thrown from some Twitter code, I believe. Focus() causes errors)
13
//TODO: Set focus on textareas when shown via a reply or retweet. (Bug is thrown from some Twitter code, I believe. Focus() causes errors)
15
//TODO: Create some kind of direct message mechanism on the main page, without refresh (hover-over user image, icon shows up?)
14
//TODO: Create some kind of direct message mechanism on the main page, without refresh (hover-over user image, icon shows up?)
16
//TODO: @reply helper (this will be hard. api only gets 100 users at a time, no way to filter through entire friend collection)
15
//TODO: @reply helper (this will be hard. api only gets 100 users at a time, no way to filter through entire friend collection)
17
//TODO: Threaded conversations
16
//TODO: Threaded conversations
18
//TODO: Format time
17
//TODO: Format time
19
//TODO: Make embedded retweet/reply work on non-home pages (single tweet pages, or on profile pages)
20
//TODo: Get username from profile link if not on home page?
21
18
22
//ADDED: Endless tweets using JSON
19
//ADDED: Endless tweets using JSON
23
//ADDED: Modify retweet (embedded retweet)
20
//ADDED: Modify retweet (embedded retweet)
...
...
29
//ADDED: Highlight replies to you (yellow?)
26
//ADDED: Highlight replies to you (yellow?)
30
//ADDED: Highlight own tweets (green)
27
//ADDED: Highlight own tweets (green)
31
28
29
//FIXED(2.17.09): Make embedded retweet/reply work on non-home pages (single tweet pages, or on profile pages)
30
//FIXED(2.17.09): Get username from profile link if not on home page?
32
//ADDED(2.10.09): Add update panel to page, to show user that there's a new version of the script (idea from Mislav via Endless Tweets userscript)
31
//ADDED(2.10.09): Add update panel to page, to show user that there's a new version of the script (idea from Mislav via Endless Tweets userscript)
33
//FIXED(2.10.09): Modify "new" tweet buttons on endless tweet load (reply, retweet, favorite, delete)
32
//FIXED(2.10.09): Modify "new" tweet buttons on endless tweet load (reply, retweet, favorite, delete)
34
//ADDED(2.10.09): Using jQuery.noconflict()
33
//ADDED(2.10.09): Using jQuery.noconflict()
...
...
52
var loading=false;
51
var loading=false;
53
var lastPage=false;
52
var lastPage=false;
54
var useJQXHR=true;
53
var useJQXHR=true;
55
var current_script_length = 22540;
54
var current_script_length = 24977;
56
var loaded_tweets = new Array();
55
var loaded_tweets = new Array();
57
56
58
57
...
...
193
			}
192
			}
194
		});
193
		});
195
	}
194
	}
195
	else if(onTwitterUsersProfile)
196
	{
197
		log("On user's profile");
198
		log("Page number: "+pageNumber);
199
		j.ajax({
200
			url:"http://twitter.com/statuses/user_timeline/"+reUrlSplitUp[1]+".json",
201
			type: "GET",
202
			data: {page:pageNumber},
203
			dataType: "json",
204
			async:is_async,
205
			success:function(data){
206
				if(data == null || data.length == 0)
207
				{	
208
					lastPage=true;
209
					pageNumber--;
210
					return;
211
				}
212
				loaded_tweets[pageNumber-1] = data;
213
				log('Successfully loaded ' + data.length + ' tweets.' )
214
				//modify_tweets(tweets_on_page,appendTweets);
215
				loading=false;
216
			},
217
			error:function(xmlhttp,errortype,errorobj){
218
				log('Error loading tweets on page load.')
219
			}
220
		});
221
	}
196
}
222
}
197
function modify_tweets(tweets,appendTweets)
223
function modify_tweets(tweets,appendTweets)
198
{
224
{
...
...
493
		if(reUrlSplitUp[4] != null && reUrlSplitUp[4].length > 0)
519
		if(reUrlSplitUp[4] != null && reUrlSplitUp[4].length > 0)
494
			pageNumber = reUrlSplitUp[4];
520
			pageNumber = reUrlSplitUp[4];
495
	}	
521
	}	
496
	log("onTwitterHomePage: "+onTwitterHomePage+" onTwitterFriendFeed: "+onTwitterFriendFeed+"
onTwitterIndividualTweets:"+onTwitterIndividualTweet);
522
	log("onTwitterHomePage: "+onTwitterHomePage+" onTwitterFriendFeed: "+onTwitterFriendFeed+" onTwitterIndividualTweets:"+onTwitterIndividualTweet+" onTwitterUsersProfile: "+onTwitterUsersProfile);
497
}
523
}
498
function add_counter_to_textareas()
524
function add_counter_to_textareas()
499
{
525
{