This plugin requires PHP5 (see Other Notes > PHP4 for more).
A widget, Twitter Search Tracker, which allows you to specify and display a Twitter search (or a Twitter hashtag) in your sidebar. Twitter searches are very flexible, and you can display anything from Hashtags to individual, or aggregated Twitter streams.
Another widget, Twitter Profile Tracker, allows you to show the tweets from a specific user in your sidebar.
Download
Latest version: Download Twitter Tracker v2.2 [zip]
Installation
The plugin is simple to install:
- Download
twitter-tracker.zip - Unzip
- Upload
twitter-trackerdirectory to your/wp-content/pluginsdirectory - Go to the plugin management page and enable the plugin
- Give yourself a pat on the back
Changelog
v2.2 2011/05/13
- ENHANCEMENT: Adds a Twitter Profile Tracker widget, which shows the tweets from just one user.
- ENHANCEMENT: Specify a “Mandatory Hashtag” to filter out any tweets which don’t have a particular hashtag (e.g. “#show_on_front_page”)
v2.12 2009/10/27
- ENHANCEMENT: Adds the ability to enter a local query for each individual page and post, this local query overrides the query entered on the widgets screen
- ENHANCEMENT: Use the new (to me) Twitter profile pic API to get the images
- BUGFIX: Use the new (to me) Twitter profile pic API to get the images
- BUGFIX: May have stomped the -1 year ago problem, where tweets were showing as tweeted -1 years ago.
v2.11 2009/10/27
- ARGH: Version numbers getting confused, so I’m trying this renumbering to hopefully cut through that confusion.
v2.1 2009/10/13
- BUGFIX: Default template now doesn’t throw a PHP error. Oops!
- ENHANCEMENT: Default template now uses Twit name, rather than the “twitter username (actual name)” format
- BUGFIX: URL encoded the query, so now works with spaces in the query
v2.01 2009/07/12
- Now allows the assignment of an individual class to each instance of the widget, good for styling your different Tweet streams to differentiate between them.
v2.00 2009/05/11
- Now using the all new WordPress 2.8 widget capabilities, soooo much easier.
- Various internal massaging.
- ENHANCEMENT: You can now hide @ replies.
- ENHANCEMENT: You can now add text after the results (e.g. for a link to the Twitter search you are using)
v1.41 2009/04/20
- ENHANCEMENT: Added a class “preamble” to the P element containing the preamble.
- BUGFIX: Slashes no longer breed and multiply in the title, preamble and search.
v1.4 2009/04/20
- ENHANCEMENT: Added class “twitter-tracker” to the widget.
- ENHANCEMENT: Added a description to show in the widget admin page.
v1.3 2009/04/10
- ENHANCEMENT: Now you can specify the number of Tweets in the widget config.
v1.2 2009/04/10
- FIX: Bug with time since information, now replaced with an i18n local date.
v0.90b 2009/03/03
- RELEASE: Version 0.90b
any tiny mce or editor?
I have 2 tweets displaying on my site, the first tweet displays but I receive this error for the second tweet “Fatal error: Call to undefined function bb_gmtstrtotime()” in “plugins\twitter-tracker\model\tweet.php on line 37″, any ideas what the problem could be?
@Phil – I’ve just added a potential fix for that issue. Would you please download the Dev Version and let me know if the problem is fixed? If it’s OK then I’ll release a new version of the plugin.
Thanks Simon, I still seem to be getting the error I’m afraid. I’ve temporarily changed the function to “strtotime()”, but the tweet time is about 40 years out. My colleague was working on a mac and he had no error. I’m on windows xp if that’s any help.
Hello. I just realized tweets in my sidebar are 1 year old! Any possible reason they are not updating?
Ours are also showing to be over a year old despite being quite new! Any thing we can do about this?
The dates for the tweets are showing up as a year old. Is there anyway to fix this yet? Thanks
Yeah, this looks like a problem with the timestamps. In model/tweet.php, the $this->timestamp is always empty so something’s not populating right. Haven’t had a change to dig in deeper today. Might look at it again at a later date…unless you get there first?
Aaaah. Right. This is a time-zones thing.
I’ve done some digging and here’s what I think is happening. The current version v2.11 is fine but the server is in the USA and so my (UK-based) latest tweets were showing up as being 6-hours in the future.
I’m not sure how this happens because both Twitter and my server should think they’re in the same place. Perhaps your plugin gets the local time zone from WordPress (which, for me is set to UK) tells Twitter to return tweets in that time zone and then subtracts it from the server’s localtime (which is US)? This results in a negative time which the time_since function prints as “-1 years ago”.
I’ve manually and temporarily got this working by adding 6 hours in the time_since maths so:
$since = $today – $this->timestamp;
is now
$since = $today – $this->timestamp + 21600
A suitable permanent fix would be either:
– Me changing my WordPress Timezone
– Me hosting in the UK
– time_since function being able to handle negative times
– An option in the plugin to tell it to print the time of the tweet rather than the time since.
I hope some of that is helpful. It’s a great plugin otherwise and is in use over at http://underthebigbluesky.org.uk
Thanks also for your prompr response to comments here. Excellent service for something that’s free!
Can you tell us how to use it in a function? I’d like to add widgets in the code including the post’s tags so they will be “relevant” tweets. There is another plugin out there that does that, but yours is superior on filtering and not bringing chinese tweets to my US site.
It doesn’t update, since I installed it’s not ‘searched’ and updated the initial tweets it loaded when plenty have gone through twitter. Brilliant plugin if it’s possible to get this fixed as it perfect to style etc! Really hoping for an update asap fingers crossed.
Great plugin, thanks!
Right now, it’s pulling through full-size pictures from Twitter profiles, rather than thumbnails – any tips on how to fix would be great.
Cheers
Got this in place and working well on a colleague’s site. Thanks for the good work!
What is the refresh interval of the twitter polling? Is it adjustable? If I’ve got a search that has results updating all the time, I’d love it if people could refresh the page in their browser and get the latest tweets (or every 2 minutes, or 5 minutes maybe).
Based on some initial (very brief) experience with the plug-in, it appears to be every 30 minutes? Or maybe every hour?
I appreciate any help or insights you could provide.
Thank you!
Hey I really like your widget but for some reason, some twitter profile pics are huge!!!!
can you take a look here? thanks
http://www.mificlub.com/news/
Just a quick question. Is there a way to block a single user out of the feed?
I keep getting this one guy who posts a giant picture of his torso dressed in spandex.. it’s awful. i want to block him.
Dear Simon,
great tool, works perfectly fine.
I have one question though.
If you have a look at my blog you’ll find the widget labeled “Current tweets”. I notice a numbering of 1…(limit of tweets) that unfortunately are outside the box that my WP theme provides.
Is there any way to get rid of the numbers (or set their color to white which would also help)?
Best,
Frank.
Nice work. Would it be possible to incorporate an option to disable the profile pic? This takes too much space and doesn’t add much value IMO.
You can hide the profile pic in your CSS.
can you give more details on the problem of large twitter pics? and hiding via css?
I tried the following CSS to force an image resize, but it didn’t work:
.avatar {
max-height: 40px !important;
max-width: 40px !important;
}
So I just went with this instead, to disable the images:
.avatar { display: none; }
@Simon: Can you point out where I went wrong? I tried several variations, such as a:link, ul, li, etc.
Oh, duh! Sorry, I’m self-taught and still learning CSS…
Here is what you add to your theme’s CSS file:
.avatar img {
max-height: 40px !important;
max-width: 40px !important;
}
I wanted to make this widget look better on my client’s site, so I made some modifications to my user.css file.
It now takes up less space on the sidebar by adding a scroll bar; profile images are all the same size; there are no bullets before tweets; and there is a border around them.
Here is what I added to my user.css:
#twitter-tracker-3 ol {
max-height:200px;
max-width: 276px;
border: 1px solid #94A3C4;
margin-left: 0px;
padding: 0 5px;
overflow:auto;
}
#twitter-tracker-3 li {
list-style: none;
}
.avatar img {
max-height: 40px !important;
max-width: 40px !important;
}
Good work!
Thanks…and nice work on the plugin!
Also, when a tweet is very short, the following tweeter’s avatar will float beside it. To solve this minor cosmetic issue I added a clear:both to the li section.
Now it reads:
`#twitter-tracker-3 li {
clear:both;
list-style: none;
}`
Great plug-in, however search queries don’t seem to work when using “near:”
Can you paste in an example of the query which doesn’t work, please?
Sure, I’ve been trying: #avlnews near:asheville
Any combination using “near” doesn’t seem to work for me.
Ah. I see the problem, and I’m afraid this isn’t something I can easily solve for you I’m afraid. Twitter’s search feeds don’t like to receive the
near:whereversyntax raw and require it converted to a separate geocode parameter. It’s possible I’ll tackle this in the future if it’s required for a client project, but I can’t guarantee any timescales.love it! thanks!
I just moved my blog to a new server with a new address, and the only problem I’m having is unfortunately with this plugin which I don’t want to go without. Initially the blog wouldn’t load until I deleted the plugin, and upon reinstalling and attempting to activate I get the follow:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /hermes/web06/b133/[internal name redacted for privacy]/htdocs/tombc/wp-content/plugins/twitter-tracker/twitter-tracker.php on line 42
Any thoughts?
Your new server is running an older version of PHP (PHP4) than your old server. This plugin requires PHP5. Talk to your hosting provider.
WordPress itself will require PHP5 at some point this year, so you will need to adapt and now might be a good time to get ahead.
Good luck!
Simon
Hi, thanks for this plugin, its awesome!
I wonder though if I can use (not sure of the correct term) %keyword% or %%sitename%% as default text: don’t know enough about coding to tell if this will work.
I’m happy to edit the file if I can get a few pointers
Thanks
Dallas
Avatar images stopped working for me – there was an XML file with a Twitter API error instead. I worked around it by replacing line 27 of model/tweet.php with this:
$this->twit_pic = “http://img.tweetimag.es/i/{$this->twit_uid}_m”;
This uses the tweetimag.es service to provide a static image URL. The API call used in the original script is clearly marked as not to be used as a img src reference, so I guess we can’t really complain…
Hey, thx for the fix! =)
This Q&A is very helpful and the plugin works better than any I have found.
I have made the images smaller. Is it possible to run the text next to the images to save space?
Is it possible not to have the tweets numbered too – to save space?
Is it possible to aggregate more than one hashtag?
Multiple hashtags sorted (just used OR between them)
Found someone with some php knowledge who fixed all these things. We seem only to be able to get it top refresh every minute without problems. Is that about as fast as it goes? Not much good for watching a hashtag at a live conferences, for example.
Dear Simon,
firs tof all great work, love your plugin!
I think displaying tweets with the hashtag of our company (#fluidnetwork) is the most authentic way to show the support and feedback of our followers and clients. But how can I secure the tweets? I would love to grab the Tweets I like, moderate them, save them in a cache seperate from twitter.
There’s no chance of doing this with your plugin?
THX for your answer!
FYI Simon, version 2.2 didn’t work for me when I was using a combination of more than one twitter feed. The syntax I’m using is this:
from:TwitterUser1 OR from:TwitterUser2 OR from:TwitterUser3
I went back to version 2.12 and that syntax works, displays all three feeds.
Thanks for the plugin regardless, other than this hiccup, very straightforward and easy to implement (and style).
Thanks for your plugin, it works very well, when it does. I have one hiccup: it works fine on all pages except my WP homepage. Any ideas?