Twitter posting lists with images


Recently I released some code to discover and embed Twinkle images linked from Twitter postings, and released a modification to Ricardo González’s Twitter for WordPress plugin which uses it.

I’ve now implemented support for Twitpic as well.

Grab the modified WordPress plugin here:

After installation, add the widget and make sure ‘Discover images’ is ticked.

For non-Wordpress users, the base code is also available here:

Include it in your twitter list source code, and use it as a filter for the message content. Something like:

$message = TwitterImageUtil::processContent($message, $mysql_database_handle);

Some configuration is possible – see the header comments for more details.

The code will create a thumbnail of the image, and store it locally. It’ll also cache the results in a MySQL database for speed. It supports Lightbox, too – just supply the relevant flag to turn it on.


  • Version 0.2.6: Bugfix for posts with both images and @mentions
  • Version 0.2.5: Bugfix from prior version, plus compatibility fix for Twitpic changes
  • Version 0.2.4: Updated to match Twitter for WordPress v1.9.2: Compatibility fix for WP 2.7
  • Version 0.2.3: Another update, chasing the moving target that is Twitpic
  • Version 0.2.2: Updated to match Twitpic’s new image storage using Amazon S3.
, , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.


  1. Posted January 26, 2009 at 7:01 pm | Permalink

    You’ve a bit of useless data in your zip file, see below;

    Archive: creating: twitter-for-wordpress/ inflating: twitter-for-wordpress/readme.txt creating: __MACOSX/ creating: __MACOSX/twitter-for-wordpress/ inflating: __MACOSX/twitter-for-wordpress/._readme.txt inflating: twitter-for-wordpress/twitter.php inflating: __MACOSX/twitter-for-wordpress/._twitter.php inflating: twitter-for-wordpress/TwitterImageUtil.class.php inflating: __MACOSX/twitter-for-wordpress/._TwitterImageUtil.class.php

    may be an idea to clean it up, the osx folders&data aren’t needed.

  2. Posted January 26, 2009 at 7:21 pm | Permalink

    Would also seem that the image discovery isn’t working for either twitpic or twinkle… take a look at the widget twitter #1, have just tried both types, and neither seem to ‘discover’ the images…

    Could you let me know if it’s broken…?

    • Posted January 27, 2009 at 10:45 am | Permalink

      Thanks for the heads-up, Luke – Twitpic and Twinkle change so often that it’s a real chore to keep up with them. There was also a bug that was introduced when integrating the latest version of Twitter for WordPress.

      Both issues should be fixed now, and I zipped it on the command line to stop OS X putting in the control files it loves so much.

  3. Posted January 27, 2009 at 3:20 pm | Permalink


    Thanks for looking at the code… Seems to work now =] another few things I’ve noticed however…

    -Twinkle pics, respect the lightbox flag, however are they supposed to be tiny when viewed in the lightbox, I would have thought a full size image would show?

    -TwitPics, don’t respect the lightbox flag, and just take you to twitpic, is that the expected behaviour?

    Cheers again

    • Posted April 1, 2009 at 8:49 am | Permalink

      I know this is an insanely late reply (my apologies), but yep, this is correct behaviour: Unfortunately, the Twitpic image URL changes frequently (probably to avoid hot-linking), so we have to open the page. Twinkle's all good though.

  4. Posted May 2, 2009 at 10:16 am | Permalink

    Great idea but i've not seen it work in practice yet. I mostly post with tweetie for iphone and if you add a photo it uses twitpic. So is this ever going to work with twitpic or do they change their service too often?

    • Posted May 2, 2009 at 1:20 pm | Permalink

      Hi Michael,

      That's a pain! It should be working with Twitpic, but as you say, they change things around so fast, I'm not really surprised it's fallen over again. I'll take another look at it soon.

  5. Posted May 2, 2009 at 9:47 pm | Permalink

    Hey I played with it and got it to work. Had to change the code a bit and work in debug mode. I'll email u the fix tomorrow.

  6. Posted May 7, 2009 at 11:36 pm | Permalink

    Hi guys ! As everyone, twitpic doesn't work for me… But, Michael Smith, if you've change the code and it's working, can u share with us right here ?

    Thanks anyway for al your efforts !

    • Posted May 11, 2009 at 7:59 pm | Permalink

      Sorry about the delay, Jess; I've rolled in Michael's changes to the official version now, 0.2.5.

  7. Posted May 12, 2009 at 8:06 pm | Permalink

    Thanks Michaels… But it doesn't seem to work on my own blog… But it's allright, it's allready a great plugin ;)

    • Posted May 13, 2009 at 10:36 am | Permalink

      Hi Jess, You probably need to clear the cache – do it by opening the widget settings ('edit' on the widget), then saving (you may need to change a setting, then change it back later, I can't quite remember)

  8. Posted October 16, 2010 at 12:13 pm | Permalink

    Hi Micheal,

    the plugin is exactly what I’ve been looking for – I’m having to use a twitter widget and a twitpic widget in the sidebar and wanted to combine them. So this should be perfect.

    Only snag is that it’s not recognising the twitpic images….

    I know twitpic keep shifting things (and it’s also a while since the last update so maybe this has been put to bed) but are you planning a new update of can you recommend a solution or an alternative?