PDA

View Full Version : Twitter status on your site.



Jaysun
23-06-2009, 07:49 PM
I've been looking around the twitter API and examples and I cant seem to find one that shows your most recent update on your site via javascript/ajax. I want to display something like:

"Hey heres a twitter update. ~ 3 minutes ago."

Johno
23-06-2009, 08:17 PM
Easiest way to do it would be to use a widget from Twitter (www.twitter.com/badges (http://www.twitter.com/badges))

I believe this code here should do what you want :) (Just edit out where it says TWITTER USERNAME to your twitter username)


<div id="twitter_div">
<h2 style="display: none;" >Twitter Updates</h2>
<ul id="twitter_update_list"></ul>
<a href="http://twitter.com/TWITTER USERNAME" id="twitter-link" style="display:block;text-align:right;">follow me on Twitter</a>
</div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/TWITTER USERNAME.json?callback=twitterCallback2&amp;count=1"></script>

Jaysun
23-06-2009, 08:41 PM
Thank you! I forgot about that. +rep =)

CANNIBALEX
24-06-2009, 06:50 AM
the badges are ugly. if you go to the badge page on twitter.com then you can get text only ones, but I found it very difficult to utilize into my website as i wanted it in a marquee in a speach bubble, but i have no knowledge of php so I could not tweak it a whole lot

Want to hide these adverts? Register an account for free!