Track Twitter search results, a Twitter hashtag, or a Twitter profile using sidebar widgets.
The plugin puts "Twitter Tracker" fields in the post and page screens, you can enter a specific query into this metabox and this will override the query entered on the widget editor... this means you can have individual Twitter search queries in the widget for each of your posts and pages. If you enter nothing in those fields then the widget will use the Twitter search query on the widget editor screen. (Developers, you can add this metabox to custom post types although you will need to use the
tt_post_types_with_override filter to get the metabox fields to save... check out the code.)
The HTML output is fairly well classed, but if you need to adapt it you can. Create a directory in your theme called "view", and a directory within that one called "category-images-ii". Then copy the template files
view/twitter-tracker/widget-error.php from the plugin directory into your theme directory and amend as you need. If these files exist in these directories in your theme they will override the ones in the plugin directory. This is good because it means that when you update the plugin you can simply overwrite the old plugin directory as you haven't changed any files in it. All hail John Godley for the code which allows this magic to happen.
These notes mainly for developers:
filters – Use this to change the Twitter Avatar URLs provided to the template. The Twitter Tracker Avatar Cache partner plugin uses these filters to provide cookie stripping caching for these avatars.
tt_avatar_bigger_url filter no longer exists, as I cannot find a way to access larger icons with the Twitter API.)
filter – Add or remove post types which can override the search query in a search widget.
filter – WARNING – incorrect use of this filter could make your website vulnerable to cross-site scripting attacks; if in doubt, do not use it. Amend the HTML elements and attributes allowed in the preamble and HTML after values. This filter passes a second param specifying the context the allowed HTML is for.
filter – The default cache for each widget is 300 seconds. Hook this filter to change this, but do not lower it too much on busy sites as you'll run out of API accesses and your site will be slower.
filter – The string displayed in the search widget when no tweets are found. The second parameter passed is the search string being used, and the third parameter is an array of other variables relating to this widget and search request.
Plugin initially produced on behalf of WordCamp UK, 2009. Initial version 2 development funded by SamFry Ltd.
Any issues: contact me.
Development for this plugin is hosted on Github, feel free to fork and submit issues there.
twitter-trackerdirectory to your
Requires: 3.1.0 or higher
Compatible up to: 3.5.2
Last Updated: 2013-8-13
Active Installs: 4,000+
Got something to say? Need help?