diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-04-17 22:49:30 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-04-17 22:49:30 -0500 |
commit | e4c2d5790bac6a74037638fde049c374fc44cc7b (patch) | |
tree | 83f5e5b7324fcb5951d755442e2e601a3eaed35a /source/javascripts/octopress.js | |
parent | 4db81a9e51e452495a06ad8c57ac4ac689a9ff34 (diff) | |
download | my_new_personal_website-e4c2d5790bac6a74037638fde049c374fc44cc7b.tar.xz my_new_personal_website-e4c2d5790bac6a74037638fde049c374fc44cc7b.zip |
irrisponsibly massive commit
Diffstat (limited to '')
-rw-r--r-- | source/javascripts/octopress.js | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/source/javascripts/octopress.js b/source/javascripts/octopress.js index d5173a47..bf94ebe4 100644 --- a/source/javascripts/octopress.js +++ b/source/javascripts/octopress.js @@ -3,6 +3,35 @@ window.addEvent('domready', function() { codeblocks.each(addExpander); }); +window.addEvents({ + domready: function(){ + if(twitter_user){ + new Request.Twitter(twitter_user, { + include_replies: false, + data: { count: 3 }, + onSuccess: function(tweets){ + $('tweets').empty(); + for (var i = tweets.length; i--; ){ + new Element('li', { + 'class': 'tweet' + }).adopt( + new Element('p', { 'html': tweets[i].text+' ' }).adopt( + new Element('a', { + 'href': 'http://twitter.com/'+twitter_user+'/status/'+tweets[i].id_str, + 'text': new Date(tweets[i].created_at).timeDiffInWords() + })) + ).inject('tweets', 'top'); + } + } + }).send(); + } + $$('#recent_posts time').each(function(date){ + date.set('text', new Date(date.get('text')).timeDiffInWords()); + }); + }, +}); + + function addExpander(div){ new Element('span',{ html: 'expand »', @@ -44,4 +73,4 @@ function enableCompressedLayout(codeblocks){ } } }).inject($('main'), 'top'); -}
\ No newline at end of file +} |