MyTwitter for Wordpress (Official Plugin Page)
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.

January 20th, 2008 at 7:06am
[...] para um plugin do Wordpress. Foi o que o Erundur Anwamehtar fez. Criou um plugin para integrar o MyTwitter diretamente aos usuários do Wordpress. O download você faz [...]
January 21st, 2008 at 10:23am
[...] can follow MyTwitter on Twitter here. For installation assistance or to leave feedback, visit the project page. You can download MyTwitter here. Filed under Blogging, Wordpress [...]
January 30th, 2008 at 6:52pm
I can’t seem to get MyTwitter to work :( It keeps throwing me the “Error: unable to access Twitter feed for user thepete.” message. My user name is accurate as is my password. I even tried leaving the password blank–either way, I get the same error message in my sidebar. :\ Any ideas?
February 19th, 2008 at 9:56pm
Latest version of Wordpress and PHP. Installed MyTwitter and get the same error as ThePete. Have put a cache folder in the wordress directory and the root directory and have set CHMod to 755, 775, and 777 to no avail.
February 19th, 2008 at 10:47pm
@Jeff what’s your Twitter username?
February 19th, 2008 at 11:09pm
For anyone having issues w/ the feed, update line 99 of MyTwitter.php (version 1.5) to the following:
<b>Error:</b> unable to access Twitter feed for user <i><?php echo
$tuser;?>. <?php echo $feed->error();?></i>
Once you’ve done this, the error message will be more specific and hopefully we can figure out why it’s having trouble. Please let me know. I’ll be sure to incorporate the error message change into the next version of MyTWitter.
February 22nd, 2008 at 2:10am
[...] Visit [...]
March 3rd, 2008 at 2:01pm
[...] MyTwitter [...]
March 6th, 2008 at 10:00pm
This is Ryan from the SimplePie project. We’re planning to make some WordPress-related changes that might affect your plugin, and we wanted you to be aware. I would encourage you to adopt some of the changes we’re suggesting because we believe that many users of SimplePie-based WordPress plugins will benefit. Feel free to direct any feedback to me. Thanks! :)
http://simplepie.org/wiki/plugins/wordpress/simplepie_core
March 24th, 2008 at 7:40am
I keep getting this “warning” when I try to post a tweet, I am not sure what it means, and I have been troubleshooting all morning long. Please help as soon as you can.
Word Press v. 2.3.3
MyTwitter v. 1.5
I don’t know how to find what version of PHP I have available.
Warning: /hsphere/local/home/bob6003/chetgassett.com/cache/35b88d9b1aeaa861772e2bf21046a00c.spc is not writeable in /hsphere/local/home/bob6003/chetgassett.com/chets_blog/wp-content/plugins/mytwitter/simplepie.inc on line 1623
March 25th, 2008 at 6:09pm
ChetG — you need to set the cache directory as writable. In the parent directory run the following command:
chmod 764 cache
March 27th, 2008 at 9:28pm
Hello. I install this plugins to my client blog (http://www.friendlycentre.com/). There’s a problem, the time was write: -1 years ago. If i check it in the twitter: http://twitter.com/friendlycentre/ there’s no problem with the time.
Can you solved it?? thx!
March 28th, 2008 at 5:14pm
rd — I’m not sure what you mean. I’m looking at the Friendly Centre site and it shows the same times as Twitter.
# tes lagi — 19 hours ago
# contoh: 60% — 19 hours ago
March 29th, 2008 at 1:23pm
Hello Erundur,
I too was running into the error “Error: unable to access Twitter feed for user xxxxxx”
I replaced the code on line 99 like you said and I now get the new error:
Error: unable to access Twitter feed for user christocarroll. XML error: no element found at line 2, column 0
Any idea what file this is talking about or more importantly what it means. I’ve been working with my host to make sure I have the proper path to my cache folder so it should be good. I’m currently running wordpress 2.3.3. you can view the page here, http://blog.flyingninja.com Thanks for your time!
Chris
March 29th, 2008 at 1:49pm
Chris — I’m not sure what the problem is. When I plugged your username into my test site it’s working fine. What version of PHP do you have?
Another thing you can try is running the SimplePie compatibility test. This is available as part of the standard SimplePie download: http://simplepie.org/downloads/ — click download. You can put the files in the mytwitter directory. Basically, you’ll be replacing the version of SimplePie currently included w/ MyTwitter (1.0) w/ the newest version of SimplePie (1.1.1) (Note: only works w/ PHP 5+). Then, you can run the compatibility_test script by going to the appropriate address for your site (http://example.com/wp-content/mytwitter/compatibility_test/sp_compatibility_test.php). Two of these especially — mbstring and iconv — seem to effect some peoples hosts ability to properly parse the RSS feed from Twitter.
I’m going to be making changes in MyTwitter 1.6 to address some of these issues, but ultimately the configuration of Apache and availability of modules on your webhost will determine how well MyTwitter (via SimplePie’s RSS parsing) are able to work.
March 30th, 2008 at 4:40am
Hi, thanks for this widget. I’ve got it mostly working except for a small issue where it does not appear to be successfully stripping out the username from the tweets.
I could not find any option in the settings so I took a quick look at the code where it appears that it should be automated. Any ideas?
March 30th, 2008 at 8:32am
@Erundur Anwamehtar
yes, when i checked, its all already working perfectly.
Thx!!! this plugin is great
March 30th, 2008 at 2:34pm
Phoenix — the capitalization is important for the automatic name removal. Make sure you use the same capitalization for your user name in the MyTwitter Options panel (or Settings panel under WP2.5) that you have showing on Twitter. For instance, currently yours is showing as “priyanphoenix” at Twitter so you’d want to put the same thing in the MyTwitter settings.
March 30th, 2008 at 3:20pm
@Erundur Anwamehtar: With capitalisation fixed it’s removing the name and working perfectly. Thanks again!
March 31st, 2008 at 12:35pm
Thank you so much for your work on this. .. question ..
I changed css to include your example css tags .. and have changed the font sz to 7 pt. .. the tag is being applied to the 1st tweet, but not the second, third, forth .. etc. Any thoughts?
March 31st, 2008 at 12:40pm
Here is some more info ..
— css snip –
/* style for each tweet */
.mytwitter_tweet {
font-size: 7pt;
}
/* style for each tweet time (e.g. 3 hours ago)*/
.mytwitter_tweet_time {
font-style: italic;
font-size: 6pt;
font-color: green;
}
/* style for each separator */
.mytwitter_separator {
font-color: green;
}
/* style for tweet #1 — you can add additional styles by adding #mytwitter_tweet-2, etc. */
#mytwitter_tweet-1 {
font-size: 7pt;
}
/* style for tweet time #1 — you can add additional styles by adding #mytwitter_tweet_time-2, etc. */
#mytwitter_tweet_time-1 {
font-size: 6pt;
font-style: italic;
font-color: green;
}
/* style for separator #1 — you can add additional styles by adding #mytwitter_separator-2, etc. */
#mytwitter_separator-1 {
font-size: 6pt;
}
/* set style for “li” element of class “mytwitter” */
ul li.mytwitter {
color: black;
}
— end snip –
wanted update time to be 6pt, italic and on next line .. so I inserted as the separator. this caused the odd behaviors (see above).
just discovered that when I use ‘ -’ it works as I want .. so now I get -time in italic, small font.
remaining questions:
1). can not see to get the ul seperator to display between tweets
2). would like to suppress my twitter name from the tweets if possible.
thoughts?
/s
March 31st, 2008 at 12:59pm
Hello Erundur,
Here is some fun info:
It seems that going to http://simplepie.org/downloads/ and updating my version of simplepie corrected my problem, however it killed my login page on wordpress. I have PHP 4.4.4 and wordpress 2.3.3. After upgrading to wordpress 2.5 everything worked great. Thanks for your time and making this great plugin.
Chris
March 31st, 2008 at 9:08pm
Chris — glad you got it working.
Steve — For your username, make sure you’re using the same case as whatever you’ve got on your twitter page (i.e. if username is “Anwamehtar” then in the Options page make sure it’s “Anwamehtar”, if it’s “anwamehtar” make sure it’s “anwamehtar). As for the CSS, I recommend just playing around with it more and make sure you’re setting the ID and class settings appropriately. For a good CSS tutorial I recommend looking at W3Schools CSS Tutorial.
April 5th, 2008 at 4:14pm
Just to let you know I was receiving the same error (I’m running beta 1.6 on Wordpress 2.5) :
Warning: /hsphere/local/home/address/username/cache/35b88d9b1aeaa861772e2bf21046a00c.spc is not writeable in /hsphere/local/home/address/username/wp-content/plugins/mytwitter/simplepie.inc on line 1623
and I solved it by deactivating the plugin, deleting the Cache folder on the root, re-creating the folder making sure it had 777 permissions and re-activating the plugin.
Works fine now.
Cheers.
April 9th, 2008 at 3:50am
It’s pretty obvious, I’m not much of a coder, or designer. My site is showing my tweets running together unless I throw in a link or reply. I just used the sample code, I want mine to look like yours. Is there a sample page where we can just copy/paste the code?
April 9th, 2008 at 1:01pm
[...] [Plugin Page]New in this version:- added CSS class to the widget and widget title, renamed the time_since() [...]
April 10th, 2008 at 1:05pm
Neat little piece of code, but I want to remove all of your styling for the plugin manager screen (what you added for 1.6). I want to wrap the code with my own styles/titles/etc. Is there any way to do that now?
April 10th, 2008 at 5:18pm
@Rob: the point of doing it w/ CSS styling is so you could change the looks by modifying the CSS code. Did you have something else in mind? Feel free to shoot me an email.
April 15th, 2008 at 2:11am
[...] el MyTwitter que es un plugin que te permite mostrar los últimos post en tu cuenta de [...]
April 19th, 2008 at 10:13pm
i’m using this one ! and i love it !
April 20th, 2008 at 3:12am
[...] widget making it about useless for me since I don’t want it in my sidebar. This is where MyTwitter comes in. I have only found this in the last few days, but it will allow you to place the content [...]
April 22nd, 2008 at 1:55pm
Hi there. I am using WP 2.5 and have this plugin version 1.6 and I’m still getting the error:
Error: unable to access Twitter feed for user MAEinSD.
I have chmod the folder for this plugin to 755. Help!
April 23rd, 2008 at 11:27am
[...] Apps « YouTwit MyTwitter April 23, 2008 MyTwitter - Wordpress plugin for displaying Tweets on your blog, also lets you update from the options [...]
April 24th, 2008 at 5:18pm
Your feed must be public for MyTwitter to work. If it’s set to private, MyTwitter will not be able to access your tweets.
April 29th, 2008 at 9:02am
[...] nem előre! Egy újjab plugint lokalizáltam! (Igaz még csak félkész.) Ime: MyTwitter.Hogy mi lesz a következő nem tudom. Elképzelhető hogy valami szavazó plugin… [...]
May 1st, 2008 at 12:55pm
[...] My Twitter: Since I’m a huge fan of Twitter I though I’d display my latest Tweets on here, you can see this in action in the ‘Social’ section no the homepage. This plugin is so freakin’ easy to use! [...]
May 2nd, 2008 at 12:31pm
[...] lesz! A az lesz majd az alap sablon, ez pedig a második. Tervem most eme sablon és a MyTwitter lokalizálása! DE most nincs kedvem írni meg gépelni meg [...]
May 3rd, 2008 at 10:16am
プラグイン「MyTwitter for Wordpress」…
最近日本語化された「Twitter」を始めてみた。 それでWordPress用にもプラグインがいくつかあることを知り、まずは以下を入れてみた。 「MyTwitter for Wordpress」 サイドバーに自分のTwitterの…
May 8th, 2008 at 5:07pm
can we have XHTML compliant output please?
the thing I’m noticing is you need the space/ in the br tags.
May 8th, 2008 at 5:10pm
nevermind…
May 9th, 2008 at 10:17pm
The content output by the plugin is XHTML compliant. If there are any problems it could be with the options you put in.
May 17th, 2008 at 11:42pm
Hi, I’m using 1.6beta on WP 2.5.1. My tweets are showing up as ‘-1 years ago’. Any idea on how to fix this? (www.shubnation.com)
May 19th, 2008 at 8:55pm
@shubjero: need more information. What version of PHP is your server running? The time should show up fine on PHP 4 and 5, but it would still help to know.
As I’m looking at your site right now, it appears to be working fine.
May 23rd, 2008 at 12:31pm
[...] myTwitter and Elegant Twitter Widget. all i can say for now is that each of them has it’s strengths. [...]
May 30th, 2008 at 11:24pm
[...] MyTwitter : MyTwitter allows users to display their recent 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. [...]
June 5th, 2008 at 11:13pm
hallo Erundur from Russia! i have just installed your plug, which started off working like a charm, just need your help to figure out a couple of points with it.
1. How can i remove a link to my twitter off the mytwitter output in the sidebar?
2. How can i remove time output from the mytwitter output in the sidebar? it seems to be in english and looks lil bit ridiculous at the russian site.
3. How can i remove default ul and li tags before and after ALL twits off plugin setting? i have them all written in the sidebar.php, and your pluging doesn’t allow to do so, always sending default tags in.
Well, looking forward to your reply! Thanx a ton!
June 5th, 2008 at 11:30pm
sorry, i found myself how to put away a link to my twitter off the mytwitter output!
still have no idea how to do so with time output or make it look russian
June 6th, 2008 at 2:22am
one more question: what is the correct syntax for the line where “turn any URL’s into links” to add target=”_blank” (open links in a new window)?
June 6th, 2008 at 2:53am
Hi,
on our blog, we want to install twice mytwitter, to show my tweets and those of my wife. I tried to copy the plugin and replace “mytwitter” by “mytwitter2″ in the code, but it was unsuccessfull. An idea ?
June 6th, 2008 at 10:43pm
@teulliac: It’s not as simple as copying the plugin because there will be issues w/ having the same function names in both plugins. I’ll put this on my list of things to check out for the next version of the plugin.
@iSynth:
$tweet = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<i><a href=\"\\0\" target=\"_blank\">link</a></i>",$tweet); // turn any URL’s into linksJune 7th, 2008 at 1:48am
thank Erundur a lot! open links in a new window now works! i just thought, do mind to write here how to correctly insert tag instead of “link” word? i tried to do so as is, but in vain, it just cracks down at
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home2/isynth/public_html/wp-content/plugins/mytwitter/mytwitter.php on line 148
June 7th, 2008 at 2:38am
and one more thing: i noticed that old tweets keep surfacing again and again in the sidebar. i checked at the cache folder and this file 8a3fb977a4d3ea520474d869f8484c30.spc keeps appearing again and again no matter if delete it or rename it!! what to do?
June 8th, 2008 at 11:07pm
hi Erundur! i found a way to insert image instead of using ‘link’ word for URLs, thus skip my question!
on the flip side, keep tracking the situation with bizarre post appearance, think there is some strange sort of misbihavior of cache permissions and updates connections with twitter.com (i guess when it fails to connect, it just forms the empty xml in cache folder)
and happy vacations man!!
June 9th, 2008 at 12:10pm
Интересно а как это работает ?
June 11th, 2008 at 12:43am
[...] MyTwitter http://anwanore.com/projects/mytwitter [...]
June 22nd, 2008 at 8:11am
[...] added a few new plugins to the mix: Sociable, Better Blogroll and MyTwitter. Very True Mood:productiveVery True Music:Cheap Honesty - Skunk Anansie Share This Thing: These [...]
June 25th, 2008 at 1:25pm
Thanks for this great plugin! It was exactly what I was looking for :)
July 15th, 2008 at 9:07pm
[...] MyTwitter: visualizza gli ultimi messaggi che lascio su Twitter. [...]
July 19th, 2008 at 1:16pm
[...] 1. MyTwitter for Wordpress [...]
July 19th, 2008 at 1:18pm
[...] MyTwitter for Wordpress Ytterligare ett plugin för Wordpress som visar dina tweets på din [...]
July 21st, 2008 at 4:35pm
[...] Check out the My Twitter Plugin. [...]
July 23rd, 2008 at 6:25am
Thanks, this is exactly what i was looking for.
July 23rd, 2008 at 11:40am
I get this error, and I don’t understand how to fix it.
I don’t get why it’s there, but the plugin is working fine otherwise, just that error message won’t leave my sidebar.
I’m using wordpress 2.6, and MyTwitter’s verson is, 1.6 beta. I’m also not sure what my version of PHP is, but I’m sure it’s the latest.
Anyhow, help would be much appreciated, thanks in advance. :]
July 23rd, 2008 at 6:24pm
@Beverts: You need to make the cache folder writable. I’ve explained how to do this previously in the comments.
July 24th, 2008 at 9:36am
@Erundur, ah it works now! Thank you very much. :]
July 30th, 2008 at 9:14pm
hi! there is something wrong with version 1.6, i do not see it in the plugins list in Admin console, while all files are there on the server side.
also i noticed your own twitter here on this site doesn’t seem to appear as well!
do you know what’s the score? tia!
July 31st, 2008 at 3:01am
[...] My Twitter Lets you add your last few twitters to your sidebar. Additionally, it also lets you add twitters from within Wordpress. [...]
July 31st, 2008 at 7:10am
Hi,
There seems to some issue with the plugin. It has stopped showing the Twitters in the sidebar. If I go to the settings and refresh the number of twitters to show, it refreshes but then stops working pretty soon after.
July 31st, 2008 at 8:22pm
@Erum: I need more information to do any diagnosis. What versions of Wordpress, PHP, and MyTwitter are you using? Did you check your cache settings? Did you check the plugin options?
August 1st, 2008 at 1:37am
I am using WP 2.5.1. Using the latest MyTwitter version as well. I didn’t really change anything. It worked fine for quite a bit.
The one day I noticed the twitters weren’t showing up. I went to the admin and added a new twitter hoping that will help. It then started giving me an error in the admin related to displaying the latest twitter. I had to comment out lines 156-160 in mytwitter.php to get the MyTwitter admin working again.
Now when I change the ‘Number of Twitters to show’ value, they show up for a short time and then disappear again.
Cache directory permissions look fine. Plus haven’t received any errors related to the cache.
August 3rd, 2008 at 6:17am
I have the same problem as @Erum (w/ same configuration).
August 3rd, 2008 at 2:21pm
I’ve had a few people mention having this problem. I’m looking into it. Twitter may have changed something w/ the way they generate the RSS feeds that MyTwitter uses to grab, parse, and display the data.
August 4th, 2008 at 4:55am
I think I have an idea what is happening.
My MyTwitter is set to display the last 5 posts. There are more than 5 so they should show up. But they don’t unless I have twittered very, very recently. So if the last twitter is more than - I am guessing a day old, they all stop showing.
August 5th, 2008 at 8:25pm
Mine does a similar thing as Erum’s. It shows on the site briefly, then goes away. On the update page, it says this:
Fatal error: Call to a member function on a non-object in /home/(folder)/mytwitter.php on line 155
Thanks!
August 6th, 2008 at 10:18pm
I am getting this messsage, I have created a cache folder and chmoded everything:
August 8th, 2008 at 7:33pm
[...] Genau deswegen twittere ich jetzt auch und belästige damit die Leser dieses Blogs. Mit der WordPress-Erweiterung MyTwitter kann man die Updates im eigenen Blog darstellen, zum Beispiel wie hier in der Sidebar. Sinnlos und [...]
August 10th, 2008 at 11:45am
Any update on the Twitter problem? I see yours disappear at this blog as well.
August 10th, 2008 at 6:22pm
@gaarf came up w/ a fix for the current issues the plugin has been having. I haven’t had time to test it yet, but it’s available at his site: http://tinyurl.com/6b2ka9.
I plan to test it soon and incorporate the changes into the next MyTwitter release.
September 4th, 2008 at 6:42am
[...] MyTwitter [...]