Some time ago i made a quick and dirty site for displaying images from a certain Twitter hashtag. Some hours ago i was asked to tweak this into a WordPress plugin, and here we go. This is just tested on my environment, but should be alright on any WordPress 3+ installation on PHP5 with libcurl.
It currently works with twitpic, instagram, yfrog, plixi, flickr. Adding more services is quite easy and can be done on request. URL’s are being curled and cached for 10-12 minutes using the built-in WP_Cache.
The plugin, when enabled, exposes a template tag which you can add to your theme:
<?php if(function_exists('hashimage')){ echo '<ul>'; echo hashimage('hashtag=unicorn&limit=5'); echo '</ul>'; } ?>
I can’t be bothered add this to the official WordPress repo, but please download it (or fork it!):
https://github.com/EarthPeople/Hashimage-WP
Some notes:
– The Twitter API only returns the latest results when searching on hashtag, so the result set is limited due to this.
– CSS is up to you. Really. I can’t do CSS. It’s magic to me.
Comments
One response to “WordPress plugin for fetching hashtag images”
this plugin was broken between august and january due to twitter implementing their t.co shortener. as of today, this is fixed. i’ve also added support for wordpress shorttags: [hashimage hashtag=”unicorn” limit=”5″]
yey.