Posting Your Latest Tweet in Wordpress

Adam Scheinberg’s profile picture

Posting Your Latest Tweet in Wordpress

Although I posted yesterday how to add your latest tweet to Wordpress without a plugin, I made several changes to the script before I posted it to make it more "generic" and re-usable. Since I've changed it quite a bit, I decided to repost it. This new script also autolinks @usernames and #hash tags.
Directions are this easy: set the path of $tw_File with a static, writable file. Set $tw_userid to your Twitter user id. Done.
Download sethadam1.com "get latest tweet" php snippet.
Back to Blog
John
2009-05-26 04:49:08
Hi. I'm trying to implement this code into my Wordpress and having a little trouble. Can you tell me exactly how to "set the path of $tw_File with a static, writable file"?
Kristoffer Benoit
2010-03-22 16:13:37
John. Make a file yourfilename.html and place it on your server. Note the URL then in the script provided enter your file name where you see this $tw_File for example $tw_File = 'http://www.yourwebsite.com/yourfilename.html'; Then make sure you have the permissions set on that file for reading and writing.
Lance
2010-04-14 18:15:08
Just curious how I would allow say 5 tweets with this?

Thanks!
Back to Blog