Created
June 1, 2010 04:32
-
-
Save dshaw/420563 to your computer and use it in GitHub Desktop.
Non-templated JS/JSON Code Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render(tweet) { | |
var html = '<li><div class="tweet">'; | |
html += '<div class="vcard"><a href="http://twitter.com/' + tweet.user.screen_name + '" class="url"><img style="height: 48px; width: 48px;" alt="' + tweet.user.name + '" class="photo fn" height="48" src="' + tweet.user.profile_image_url + '" width="48" /></a></div>'; | |
html += '<div class="hentry"><strong><a href="http://twitter.com/'; | |
html += tweet.user.screen_name + '" '; | |
html += 'title="' + tweet.user.name + '">' + tweet.user.screen_name + '</a></strong> '; | |
html += '<span class="entry-content">'; | |
html += container[twitterlib].ify.clean(tweet.text); | |
html += '</span> <span class="meta entry-meta"><a href="http://twitter.com/' + tweet.user.screen_name; | |
html += '/status/' + tweet.id + '" class="entry-date" rel="bookmark"><span class="published" title="'; | |
html += tweet.created_at + '">' + container[twitterlib].time.datetime(tweet.created_at) + '</span></a>'; | |
if (tweet.source) html += ' <span>from ' + tweet.source + '</span>'; | |
html += '</span></div></div></li>'; | |
return html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Props to @Rem for his useful TwitterLib, which this is sampled from.
http://github.com/remy/twitterlib/blob/master/twitterlib.js