MyTwitter @ Twitter: twitter.com/MyTwitt3r

Current MyTwitter Version: 1.6 beta (March 30, 2008) — Wordpress 2.5 Compatible!
Download (Zip) (hosted at official Wordpress Plugins site)
Note: Only download from sites you trust. I’ve seen a few illegitimate spam sites popping up with ripped-off copies of the text and files with no attribution.

About: MyTwitter allows users to display their Twitter status updates (tweets) on their Wordpress site and update their status through the Options page. Includes customization options including number of recent twitters to display, formatting options, and stylesheets. It can be called as a function or used as a widget.

Donate: If you appreciate the MyTwitter for Wordpress plugin, please consider leaving a donation for the author.


Compatibility: Tested and works with Wordpress 2.3 to 2.5, but should work with Wordpress 2.2+. Tested and works on servers with PHP versions 4.7 and 5.2+.

Requirements: SimplePie is required and version 1.0.1 is included in the distribution file. (I may update this to SimplePie 1.1 soon, but this would remove support for PHP 4 so I haven’t yet.) For best performance, the following PHP modules are recommended and you may have problems if you’re missing them on your webhost: XML, PCRE, cURL, Zlib, mbstring, iconv (see also: SimplePie Requirements).

Installation: Extract the contents of the archive. Upload the mytwitter folder to your Wordpress plugins folder (e.g. http://yoursitename.com/wp-content/plugins/). Set your preferences in the Wordpress Options panel for “MyTwitter” (including username, password, and formatting options). Set the Cache Life to the length of time for the Twitter feed to be cached before checking for updates.

If it doesn’t already exist, create a folder named “cache” in the root directory or your webserver (and give it write permission - chmod to 755) or alternatively edit the CACHELOC value in the plugin to point to a different location (if you do this you may need to reupload the plugin) — the cache location will be added to the Options panel in a future version.

Stylesheets: Example CSS code is included in example.css. To incorporate on your site, copy/edit the code to the stylesheet for your current wordpress theme. For most themes, this can be done by going to Presentation -> Theme Editor and then select “Stylesheet” from the theme files list. The following is the CSS classes/IDs you can use to style your tweet output (additional notes available in the example.css file).

CSS Classes: mytwitter, mytwitter_tweet, mytwitter_tweet_time, mytwitter_separator
CSS IDs: mytwitter_tweet-1, mytwitter_tweet_time-1, mytwitter_separator-1 — the number increases sequentially for each tweet displayed. If you are displaying 5 tweets, they will be numbered from 1 to 5, (mytwitter_tweet-1, mytwitter_tweet-2, etc.)

To Display Your Twitters:
Call the mytwitter() function from your sidebar template or wherever you want to display your recent tweets. If you have a widget-enabled theme, you can add it to your sidebar by going to the Wordpress Presentation tab, selecting “Widgets” from the menu, and then drag “MyTwitter” to the location you want it displayed on your sidebar.

<?php if (function_exists(’mytwitter’)) { ?>
  <li><? mytwitter();?></li>
<?php } ?>

Comments/Questions/Errors: Please leave a comment if you have errors or suggestions. If commenting about an error, include your versions of MyTwitter, Wordpress, and PHP. (Note: First-time comments are moderated.)

Credits: MyTwitter was inspired by Sarah Isaacson’s Twitter Wordpress Sidebar Widget. Some ideas inspired by and/or adapted from Alex King’s Twitter Tools 1.0 plugin.

Contributions: I’ve incorporated a code modification written by Sascha to enable MyTwitter usage as a widget. @replies parsing function updated with code from @krokodilerian (site).

Warranty: This program is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

CHANGELOG:
v. 1.6

  • added CSS class to the widget and widget title, renamed the time_since() function to mytwitter_time_since()
  • verified compatibility w/ Wordpress 2.5 (it works!)

v. 1.5

  • updated parsing for “@” replies (courtesy of @krokodilerian - http://vasil.ludost.net/blog/)
  • added additional formatting options including ability to style w/ CSS and change order of tweet/time
  • added mytwitter_mostrecent() function to display the most recent update (w/o formatting options) in the Options panel for MyTwitter

v. 1.4

  • added cache life setting, default is set to 900 seconds (15 minutes)

v. 1.3

  • changed version numbering to 1.x instead of 1.0x to match the numbering used at the Wordpress Plugin Database
  • added the ability to post status updates from the Options page for MyTwitter

v. 1.02

  • incorporated Sascha’s modifications to enable use of MyTwitter as a widget in widget-enabled themes

v. 1.01

  • modified the time display code to correctly function on servers with PHP version 4
  • updated the documentation

Old Versions: If you need an old copy of the plugin for any reason, just let me know.