Skip to content

Commit

Permalink
switch to supertweet, make threads simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
nferrier committed Sep 3, 2010
1 parent 1cb5607 commit f7dc44b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions twaddle.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
body {
margin-left: 0;
font-family: sans-serif;
}

.hidden {
Expand Down
2 changes: 1 addition & 1 deletion twaddle.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
name="update"
target="tweetsink"
method="post"
action="http://api.twitter.com/1/statuses/update.xml">
action="http://api.supertweet.net/1/statuses/update.xml">
<input
type="hidden"
id="reply_id"
Expand Down
16 changes: 8 additions & 8 deletions twaddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ var twaddle = new Object({
// Can pass in 'since' if it's supplied.
// When the updates arrive formats them as per the #tweettemplate
// and then pass the resulting HTML to 'fn'
var urlstr = "http://api.twitter.com/1/statuses/home_timeline.json?count=200&callback=?";
var urlstr = "http://api.supertweet.net/1/statuses/home_timeline.json?count=200&callback=?";
if (since) {
urlstr = "http://api.twitter.com/1/statuses/home_timeline.json?count=200&since_id=" + since + "&callback=?";
urlstr = "http://api.supertweet.net/1/statuses/home_timeline.json?count=200&since_id=" + since + "&callback=?";
}

$.getJSON(
var x = $.getJSON(
urlstr,
function (data) {
function (data, textStatus) {
$.each(data.reverse(), function(item, tweet) {
// Store the contact for later, including how many tweets
if (twaddle.contacts[tweet.user.screen_name] == undefined) {
Expand All @@ -75,7 +75,10 @@ var twaddle = new Object({
"created_at": tweet.created_at,
"reply_class": "hidden"
};
if (tweet.in_reply_to_status_id != undefined) {
// FIXME
// would like to make proper thread list pulling in all refs to the thread
if (tweet.in_reply_to_status_id != undefined
&& twaddle.contacts[tweet.in_reply_to_screen_name] != undefined) {
var id = tweet.in_reply_to_status_id;
var screen_name = tweet.in_reply_to_screen_name;
attribs["reply_class"] = "";
Expand All @@ -90,9 +93,6 @@ var twaddle = new Object({
attribs["reply_created_at"] = $('#' + id + " div.date").text();
attribs["reply_html"] = $('#' + id + " span.text").html();
}

// Now delete the original reply
$("#" + id).remove();
}
fn(attribs, tweet);
});
Expand Down

0 comments on commit f7dc44b

Please sign in to comment.