Skip to content

Commit

Permalink
Added yfrog and pic.im
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmorrison committed May 9, 2009
1 parent d857478 commit 5b4d399
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion javascripts/tweetwall.js
Expand Up @@ -37,7 +37,7 @@
var url = 'http://search.twitter.com/search.json?q=' + query + '&rpp=30&callback=?';
$.getJSON(url, function(data) {
$.each(data.results, function() {
tweets.push($('<li><img class="profile" src="' + this.profile_image_url + '"/><span class="from">' + this.from_user + ':</span> ' + this.text.replace(/http:\/\/twitpic\.com\/([\w\d]+)/, '<img src="http://twitpic.com/show/thumb/$1" class="twitpic">') + '</li>'))
tweets.push($('<li><img class="profile" src="' + this.profile_image_url + '"/><span class="from">' + this.from_user + ':</span> ' + inlinePics(this.text) + '</li>'))
});
});
}
Expand All @@ -64,6 +64,14 @@
}
window.setTimeout(fetchFlicks, 120000);
}


function inlinePics(text) {
return text
.replace(/http:\/\/twitpic\.com\/([\w\d]+)/, '<img src="http://twitpic.com/show/thumb/$1" class="twitpic">')
.replace(/http:\/\/yfrog\.com\/([\w\d]+)/, '<img src="http://yfrog.com/$1.th.jpg" class="twitpic">')
.replace(/http:\/\/pic\.im\/([\w\d]+)/, '<img src="http://pic.im/website/thumbnail/$1" class="twitpic">')
}

fetchTweets();
fetchFlicks();
Expand Down

0 comments on commit 5b4d399

Please sign in to comment.