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.