Wordpress Twitter Widget
My latest plugin is a sidebar widget that handles Twitter feeds. It’s true that you could just point and RSS widget at one of the Twitter feeds, but you end up with the whole tweet (I honestly don’t know what they are called) as a link, @replies don’t function, etc. Twitter Widget Pro properly handles twitter feeds, including @username and link parsing, feeds that include friends or just one user, and can even display profile images for the users. It’s set up like the RSS widgets, so you can have as many of as you want on your sidebars.
I currently have my twitter feed in the right sidebar, showing the last five tweets, and Kevin Rose’s feed (with friends) in the left sidebar, showing profile images along with each of the last 10 tweets.
I tried to make everything easily styled, so there are no built-in styles. If you don’t know exactly what you need, here is what I’m using on this site:
/**
* Twitter Widget
*/
.widget_twitter li {
clear:both;
}
.widget_twitter li img {
float:left;
margin-right:.5em;
}
.widget_twitter li .clear {
clear:both;
}
Changelog
- 04/23/2008: 1.1.0
-
- Most major fix is the inclusion of json_decode.php for users that don’t have json_decode() which was added in PHP 5.2.0
- Fixed problem with displaying a useless li when profile images aren’t displayed on a single user widget
- Default title is now set to “Twitter: UserName”
- 04/17/2008: 1.0.0
-
- Released to wordpress.org repository
- 04/14/2008: 0.0.3
-
- Fixed some of the settings used with Snoopy
- Set a read timeout for fetching the files
- 04/14/2008: Version 0.0.2
-
- Changed some function names
- Moved form display to a separate function (_showForm)
- Now uses wp_parse_args to handle defaults
- Added comments to the code
- Added seconds to the _timeSince function so you can have something like “about 25 seconds ago”