Subscribe

I have moved to newlyancient.com and will be writing regularly there! Content on this domain is no longer updated, but will be maintained as an archive in its original form.

WPTWIT is a plugin for WordPress which integrates Twitter into your site. With a useful sidebar widget and a powerful templating system, this plugin allows you to keep your visitors updated with your latest tweets. You can see the plugin in action by looking at my sidebar. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License. Just download it already! Or, are you having trouble? I can help!

Join the 903 people who have downloaded WPTWIT.

Features

  • Simple templating system.
  • Automatic time offset detection.
  • Included sidebar module/widget.
  • Uses the integrated WordPress RSS parser.

Documentation

  1. Download the plugin.
  2. Unzip to your plugins directory.
  3. Activate the plugin.
  4. Go to Options — WPTWIT.
  5. Enter the URL of your Twitter RSS in the Feed URL field. You can use the URL by going to bottom of your Twitter page and right clicking RSS Feed.
  6. Enter the number of statuses you would like to display in the Number of Statuses to Display field.
  7. Put anything you would like to appear before the list in the Before List field. (eg. <ul>)
  8. Put anything you would like to appear after the list in the After List field. (eg. </ul>)
  9. Enter the date format you would like to use in the Date Format field, according to the PHP format.
  10. Enter the template you would like to use in the Default Status Template field. Use the template tags in it. (eg. <li class="current"><a href="%link%" rel="bookmark" title="%time_ago%, ago I was %status%"><span class="time">%date%</span><span class="status">I was <strong>%status%</strong>.</span></a></li>)
  11. Enter the template you would like to use for your latest status in the Current Status Template. Use the template tags in it. (eg. <li class="current"><a href="%link%" rel="bookmark" title="%time_ago%, ago I was %status%"><span class="time">%date%</span><span class="status">I am <strong>%status%</strong>.</span></a></li>)
  12. Click Update Options ».

You should be able to add the Twitter Module to any widget-enabled theme. It will automatically call the list, with a containing div class of sb-twitter. If your theme does not support widgets, you can call <?php ae_wptwit_output(); ?> to produce similar output.

Template Tags

%user%
Displays the username from twitter feed.
%status%
The status message with username stripped.
%update%
The twitter status message.
%parity%
Output the parity of the message. (Odd or even, starting from current message as odd)
%date%
The date of message; formatted according to date format above.
%time_ago%
How many hours/minutes ago the status was sent; if over 24 hours will say ‘over 24 hours’; if over 2 hours, will say ‘over x hours’; if less than 2 hours, will say how many hours/minutes ago
%link%
Outputs a link to the status on Twitter.

Changelog

  • 1.0 beta

    • Initial public release
  • 1.1

    • Added better time zone support
  • 1.2

    • Added support for PHP 4
    • Improved time zone support
  • 1.3

Need a custom plugin or theme? Contact me to work something out.

57 Responses to “WPTWIT”


  1. 1 hoboken411

    What do I need to put in my sidebar if I don’t use widgets?

  2. 2 arthus

    @hoboken411:

    PHP:
    1. <?php ae_wptwit_output(); ?>

    This should produce your list, with before and after templates included. I have updated the documentation accordingly.

  3. 3 Luca Moretto

    Great Plugin!

  4. 4 arthus

    @Luca: I’m glad you like it.

  5. 5 Carson Weber

    The timezone is off when it is integrated into my website at http://carsonweber.org (see sidebar under “WHAT I’M DOING”)

  6. 6 arthus

    How much is the time off by? I am looking at the best way to set the time.

  7. 7 Emre

    The timezone is off when it is integrated into my website at

  8. 8 arthus

    The latest version relies upon the WordPress time zone setting to establish the correct time. If it doesn’t work for you, check that setting.

  9. 9 jl

    I get the following error message:

    Fatal error: Call to undefined function: str_split() in /home/xxxx/xxxx/mindfulofmirrors/wordpress/wp-content/plugins/twitter.php on line 20

    Any ideas why?!?!

  10. 10 arthus

    @jl: It was an issue where your version of PHP (PHP 4) did not support the command used in my plugin. I have now updated the plugin with alternative code so that it should be PHP 4 compatible. Download the new version and if you have any further issues, don’t hesitate to bring them up. Thanks for brining this to my attention.

    P.S. The alternative code may also improve time zone handling for some people. (Time zone handling is a hard thing for me to test for obvious reasons)

  11. 11 jl

    arthus: thanks for the reply. i downloaded the plugin from this link but it’s v1.0 beta.
    http://myfla.ws/download/wptwit

    where can i get the new version?

  12. 12 arthus

    Sorry about that, I forgot to update the version of the zip. The new version should be online now… feel free to download.

  13. 13 jl

    thanks for that arthus… but the new version still doesn’t seem to be accesible from that link. I keep getting the older v1.0 beta… would you mind emailing the new version to me?!?

    thanks heaps!

  14. 14 arthus

    That is very strange… I tested the download and I am getting the new version. You might try clearing the cache and ensuring you are unzipping it correctly. I sent you the new version by email anyways.

  15. 15 jl

    arthus: thanks for the file - i got it!

    but now i’ve got another problem! although I set the options to display the last 3 or 5 statuses, only the most recent appear - is something amiss?!?

  16. 16 arthus

    I have no idea why that would be happening to you. If you have a link to your page with this on it, that would be helpful. The problem might be that you didn’t fill out both templates in the admin panel - be sure to do so. Even if you use the same styling for new and old statuses, you must have the template completed for both.

  17. 17 jl

    it’s very strange… i’ve filled out both templates on the admin/options panel. in fact, i’ve filled out all the fields in the options panel. you can see my blog here:
    http://www.mindfulofmirrors.com/

    it’s right at the bottom.

  18. 18 jl

    arthus: more strange updates!

    the plugin will display the current status and ONE older status but despite setting the options to display 5 statuses, the plugin will output no more than the current status and ONE older status and i know i have more than 2 statuses on my twitter account.

    any ideas what could be wrong…?!?

  19. 19 arthus

    jl: I think I might have found your problem. My plugin does not play nicely with the widgets plugin unless you use my own widget. So, to fix it, just enable the twitter widget in your footer.

  20. 20 niuhuifei

    Hi, I am using your wonderful plugin now, it work so good but only one problem, it seems not support Chinese. When I post some Chinese words in twitter, this plugin always displayed “??????????”. Can you help me? thanks!

  21. 21 arthus

    @niuhuifei: I have looked into this and there doesn’t seem to be any problem. As you can see from my sidebar, chinese characters display fine with this plugin. The plugin will print out exactly what is recieved from Twitter.
    I have a suspension that your issue might be arising from a character set issue. If you look in the source of your page it will proboably display the chinese fine - it is just not working once the character set tries to process it.
    You actually appear to be setting the character set twice, so removing one of the lines should fix it. (From header.php in your theme)

  22. 22 niuhuifei

    Many thanks for your reply. But it also not work well in my site when I post Chinese. I have removed the second character set from my head.php. My theme isnot wedgted, and I just use the . I don’t know why, my god!

  23. 23 arthus

    I have no idea what your problem is. I would look into PHP settings or WordPress parsing settings. WPTWIT uses the built-in Magpie RSS to read your Twitter feed - that could be the source of the problem. No idea otherwise. Sorry!

  24. 24 niuhuifei

    Hi, a good news, I have fixed my problem, it is not due to your plugin, but my space. now it work well. thank your good plugin again!

  25. 25 arthus

    Glad to hear everything is working for you.

  26. 26 Melinda

    When I put in the variable to include WPTWIT, I got this error message:

    Warning: array_slice() [function.array-slice]: The first argument should be an array in /home/.jaffa/melindam/rinato.eorlingas.org/wordpress/wp-content/plugins/twitter.php on line 25

    Warning: Invalid argument supplied for foreach() in /home/.jaffa/melindam/rinato.eorlingas.org/wordpress/wp-content/plugins/twitter.php on line 31

    If you could help me with that it would be much appreciated!

  27. 27 arthus

    From the looks of it, it appears your Twitter feed is blank.
    Either you have not configured it correctly with your Twitter RSS feed or you need to get tweeting!
    If you can tell me your twitter username, I can try to help you a bit more.

  28. 28 Melinda

    engulf: http://twitter.com/engulf

    I tweeted three times to test things out for the plugin, but I got that error message instead. Thanks in advance!

  29. 29 arthus

    Make sure that you have configured the options page correctly. These settings should work for you:
    Feed URL: http://twitter.com/statuses/user_timeline/8893472.rss
    Number of Statuses: 5
    Before List: <ol>
    After List: </ol>
    Date Format: D H:i
    Default Status Template: <li class=\"current\"><a href=\"%link%\" rel=\"bookmark\" title=\"%time_ago% ago I was %status%\"><span class=\"time\">%date%</span><span class=\"status\">I was <strong>%status%</strong>.</span></a></li>
    Current Status Template: <li class=\"current\"><a href=\"%link%\" rel=\"bookmark\" title=\"%time_ago% ago I was %status%\"><span class=\"time\">%date%</span><span class=\"status\">I am <strong>%status%</strong>.</span></a></li>

    If it still doesn’t work, please check back. The next version of my plugin will be far easier to configure.

  30. 30 arthus

    This is most likely just an issue of caching. Give it some time and the problem will hopefully iron itself out.

    Also, be sure that Default Status Template and the Current Status Template have something in them.

  31. 31 Melinda

    Thanks for the advice, but it still only shows one update. D: Thanks anyway though!

  32. 32 Daryl

    Great plugin! It works great for me, but now Im trying to format it to my liking.

    Im wanting to have alternating backgrounds for each tweet. I can do the code, but is there a counter variable built in that I can call?

    I was hoping to do something like:

    if $i is even: use this bg color
    if $i is odd: use this alternate bg color

    I guess my question is… is there a built-in “$i” that I can use?

    Thanks a ton!
    Daryl

  33. 33 arthus

    Thanks for the suggestion, Daryl.

    I have pushed that feature into the 1.3 release. Now just call the %parity% variable in your template and it will return odd or even based upon the parity of the number. (I figure you can do the rest with CSS)
    You don’t need to touch any of the plugin code to get this to work. :)

  34. 34 Catzie

    Great plugin! It’s very useful to me. Thanks!

  35. 35 arthus

    Glad it’s helpful, Catzie!

  36. 36 phpsourcecode

    I have looked into this and there doesn’t seem to be any problem. As you can see from my sidebar, chinese characters display fine with this plugin. The plugin will print out exactly what is recieved from Twitter.
    I have a suspension that your issue might be arising from a character set issue. If you look in the source of your page it will proboably display the chinese fine - it is just not working once the character set tries to process it.
    You actually appear to be setting the character set twice, so removing one of the lines should fix it. (From header.php in your theme)

  37. 37 arthus

    Thanks for sharing that… I’m glad there are no issues with my plugin. I think he ended up getting the issue fixed on his space. Thanks for sharing anyways. :)

  38. 38 Patrick Curl @ Theres a Blog in My Soup

    Great Plugin for Twitter - very useful. Keep up the good work!

  39. 39 arthus

    @Patrick: Thanks!

  1. 1 Twittering Away at Newly Ancient
  2. 2 Weblog Tools Collection » Blog Archive » WordPress Plugin Releases for 05/03
  3. 3 תוספים לוורדפרס 2-3.05.07 : הבלוג של אח”י דקר
  4. 4 WeblogToolsCollection Español » Blog Archive » Plugins de WordPress publicados 3/5
  5. 5 WP Twit at La bottega di kit
  6. 6 Blog de Kilgore » Blog Archive » XMLRPC, Wordpress et plugin/widget Twitter, mariage difficile !
  7. 7 30+ Tools to Turn Wordpress into a Personal Hub
  8. 8 WORDPRESS GOD:300+ Tools for Running Your WordPress Blog
  9. 9 Tools to make wordpress more personal. | Techmartini.com
  10. 10 点名游戏:我喜欢的wordpress插件
  11. 11 WordPress Plugins Database » Plugin Details » WPTWIT
  12. 12 300+ Popular Plugins for Running Your WordPress Blog
  13. 13 Wordpress god300 tools for running your wordpress blog by mashabale.com · Cyber Space in One Hand
  14. 14 阿杜在线 » Blog Archive » 可以把 WordPress 变成个人信息中心的工具和资源
  15. 15 ARHI » Blog Archive » Pluginuri de baza pentru un blogger
  16. 16 Maximino
  17. 17 Agregate Your Life | The Daily Punt
  18. 18 天哪:300多个插件运行到你的WORDPRESS | 灵度CLEVER8 O-Town