Pages

Wednesday 27 June 2012

Show Twitter Messages on a web Page

The below code was automagically generated by twitter’s badge utility. You should be able to change “yourtwittername” in the code to your twitter name and stuff it in a block. This should work OK for site wide usage, but if you want each user to have there own, in say their profile page, there needs to be a hook to pull the users info and stuff it in a variable. I know it can be done and there is already a pending patch to do something similar I just don’t have the time right now.

<div id="twitter_div">
<h2>Twitter Updates</h2>
<ul id="twitter_update_list"></ul></div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script text="text/javascript" src="http://twitter.com/statuses/user_timeline/yourtwittername.json?callback=twitterCallback2&count=5"></script>

No comments:

Post a Comment