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:
twitter-for-wordpress-plus-images-v0.2.6.zip
After installation, add the widget and make sure ‘Discover images’ is ticked.
For non-Wordpress users, the base code is also available here:
TwitterImageUtil.class.php-v0.2.6.zip
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.
Updates
- 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.