WordPress Plugin: Twitter Stream
It’s been just over a year now since I released my first plugin which you may all know is The Attached Image, so I thought it was time I released another plugin. I hadn’t actually gone out on purpose to make this plugin, but a client’s website needed a simple Twitter feed plugin & while there are already WordPress plugins out there that do the job they insisted a custom one be built. So I set about making it & rather than have it sit in my WordPress functions folder doing nothing (other than working on the client’s site, of course) I thought I should release it as a plugin for anyone to use. 🙂
Latest Info – 04/03/2013
If you have updated the plugin to version 2.5 and are having trouble, please make sure to delete the cache. Either manually or using the button on the options page.
What is Twitter Stream?
Twitter Stream is a very simple plugin originally created as a small function for a client’s website. Rather than have it sit doing nothing in my WordPress functions folder I thought I would extend it and make it into a plugin for everyone to use.
It’s functionality is very, very simple. It is designed to simply grab a set amount of status updates from the Twitter user account you request. If there are enough requests I may add some additional features, but for now it is designed to be very simple and run as quickly as possible while using the least amount of resources possible.
What Features Are There?
- Connect to Twitter securely using oAuth. (required)
- Show the twitter timeline for any public username.
- Choose how many tweets to show.
- A Widget or template function is available.
- File caching to stop API overuse.
- Optional date shown in xx ago format, also links to permalink for the tweet. (Requested by Ron)
- Customizeable via CSS. (see the ‘Can I Style It?’ section below)
- Authentication for better API limiting & ability for protected users to show their tweets.
- @replies now link to the user profile of the user you are replying to.
- #tags now link to the Twitter search page for that hash tag.
- Link to user’s profile, customizable via CSS & via function parameter.
- Follower count can now be shown.
- Retweets can now be shown with normal tweets.
How Do I Install It?
You can download it from the WordPress repository here, and then install it as you would any old style WordPress plugin, which is as follows:
- Download the zip file and unzip it to somewhere, say your desktop.
- With any good SFTP client upload the extracted folder to your
wp-content/plugins/
folder. - Enable the plugin in the WordPress plugin page.
Of course you can also install it by using the WordPress auto installer.
How Do I Use It?
Due to Twitter not having a solution for open source applications using oAuth yet, you must follow some slightly more complicated instructions to sign in via oAuth. Comprehensive instructions are provided in the plugin but here is a rough overview.
First you need to register a Twitter App, save the consumer keys you are provided with, then sign in with Twitter. As I said more detailed instructions are provided as you set up the plugin, including tips for what to enter when registering you app.
Finally you can show your tweets using a widget. The widget is a WP 2.8 & up compatible widget. If you are using a WP version lower than 2.8 you should really upgrade for security reasons if nothing else.
If you are a good ‘ol fashioned function user then you can call Twitter stream using:
1 |
twitter_stream($arg); |
Providing either a keyed array or an argument list. All the parameters available are listed here.
How Do You Get Round The API Limit?
Now that oAuth has been implemented API requests will be counted against your personal account rather than your servers IP address meaning that shared servers should no longer cause a problem. However to reduce the possibility of overusing the API even further caching is still in use.
Sometimes I Get An Error Message!
There is a built in error message that is shown if Twitter fails to provide a vaild XML file. Reasons for this could be that the Twitter API is down (which Twitter claim is highly unlikely), or the plugin failed to read the cache file. If this happens, and you know Twitter is available, try deleting the cache file which is named username.cache
. You can do that using the brand new ‘delete cache’ button which is shown on the bottom of the authorization page. Just click ‘Twitter Stream’ under the settings menu to find it.
Sometimes The Date Is -xx Seconds Ago?
This is sometimes difficult to get your head around. Simply put it is caused by your servers clock being faster or slower than Twitters clock. To work out the time ago it takes the timestamp (number of seconds since Unix Epoc) and takes it away from the timestamp at which the tweet was posted. If your servers clock is slower than Twitters, for the first few seconds it ends up giving a negative value therfore seeming as if it was posted in the future. It could be something completely different involving Aliens, badgers and evil pidgeons, but that is the most sensible thing I’ve been able to come up with. If you have a better idea what it is let me know.
Sometimes oAuth Misses The Deny/Accept Page When I Press ‘Sign in with Twitter’?
This happens if you have already authorized Twitter Stream to be used with your Twitter account. Until you press the sign in button the plugin can’t tell if you have already given authorization or not. This generally happens if you have more than one blog using Twitter Stream with the same Twitter account. It’s perfectly normal though.
Can I Style It?
You can. I haven’t added any styles so I could keep the plugin on one file & keep it free of clutter. The available CSS classes are:
.at-reply
for @replys..hash-tag
for #tags.a.twitter-link
for autolinked URL’s within the timeline.a:hover.twitter-link
for autolinked URL’s within the timeline when they are hovered over.a.twitter-date
for the date permalink.a:hover.twitter-date
for the date permalink when it’s hovered over..profile-link
for the newly added link to user profile..follower-count
for the newly added follower count.
Can I Have A Options List?
Sure. The basic usage for in the template is this.
1 |
twitter_stream( [query-string/array] $args); |
Here is the info for each parameter.
username
should be a string and is the username of the Twitter timeline you want to return. No longer required. If omitted will show the user who authorized Twitter Stream’s timeline.count
should be a string and is how many tweets to return. Default ’10’.date
bool or string. If set to TRUE it will show the time ago with a hyphen as a default separator. If it is a string of anything other than ‘TRUE’, ‘true’ or ‘1’ it will use that as a separator.profile_link
a string. Allows you to customize what the link to your Twitter profile (shown at the bottom of the tweets) says. ‘Visit My Profile’ by default. Use a space, like this ‘ ‘, to show nothing.retweets
bool, true or false. Shows retweets with normal tweets.show_followers
bool, true or false. Shows the number of followers.cache_time
Set the length of time tweets are cached for.echo
Controls if the tweets should be echoed out to the page or returned as a SimpleXMLObject for manipulation via PHP. Defaults to TRUE, meaning echo tweets to page.
Here is an example using all parameters.
1 2 3 4 5 6 7 8 9 |
twitter_stream(array( 'username' => 'twitteruser', 'count' => '10', 'date' => FALSE, 'profile_link' => 'Visit My Profile', 'retweets' => FALSE, 'show_followers' => FALSE, 'cache_time' => 30, 'echo' => TRUE )); |
I Need A Translation!
You can download translations files for the plugin here. These are .po & .mo files in a zip for the languages available. For the translation to work you only need the .mo file placed in the same folder as the plugin.
- Swedish Translation – Thanks to Albert Johansson
- Belarusian Translation – Thanks to FatCow
- French Translation – Thanks to Tolingo.com
- Dutch Translation – Thanks to Rene
- Alternative Dutch Translation – Thanks to Sander Van Vliet
- Spanish Translation – Thanks to inMotion Hosting
- Serbo-Croatian Translation – Thanks to Borisa Djuraskovic (WebHostingHub)
- German Translation – Thanks to Stefan Moeller
I have provided the .po file for those who would like to amend or alter anything. Should you do that please send me a copy of the amended .po file so I can update the files here. If you would like to translate Twitter Stream into a language not available here you can download a blank .po file here. Once you’ve done the translation send it to me at admin [at] return-true [dot] com.
A huge thank you to those who have translated so far & a big thank you to anyone who may help in the future.
I Have A Feature Request! / I’ve Found A Bug!
You can report all bugs via the comments which I read as soon as I can, or you can send me an email via the contact page. Either way I promise to try and get back to you as soon as possible.
I Want To See A Working Demo?
Okay. Well the Twitter timeline here on Return True (on the right) is created using Twitter Stream. You can also see it on Medibolism & on Lisa Marie Art’s website.
Where Do I Get It Again?
Once again you can download it from the WordPress plugin repository here, or you can install it via the WordPress auto installer in your blog admin.
I Love It, Can I Give You Some Love?
Wait… What?!! Oh you mean that sort of love. Sure. 😛 You can help out in one of three ways. You can donate to help cover server costs & the cost of the coffee that keeps me coding. You can do that by clicking the button below.
You can buy me a present from my Amazon Wish List which would be very much appreated, or you can simply spread the word about Twitter Stream & The Attached Image.
Well that’s about it if you find any bugs or have any requests let me know.
Note: Twitter bird artwork in header image created by lisa-marieart.com. Used with permission.
445 Comments
Sean Duran
This plugin is exactly what I’ve been looking for. Though I can’t seem to get it to work on our site. I currently have 2 instances of it in our sidebar, but nothing seems to load. Any ideas? Thanks!
Paul Robinson
Well I’m really confused as I’ve put error messages in place for every problem I can think of. If possible can you tell me if you have CURL or fopen (with URL access enabled) available?
I’ll have a look through the file for any problems, but as if works everywhere else so far I’m guessing it is something to do with your server configuration.
Paul Robinson
I may have found something. The only point I can find where there is no error message is if
fsocketopen
fails as it’s highly unlikely.If you can try editing the
twitter-stream.php
file and change:to
If when you refresh your site you see that error it means it was unable to connect. If that happens I am currently unaware of a way to fix it, but I’ll keep looking. If you have CURL or fopen available though this won’t matter. Just thought I’d share this just in case.
Sean Duran
Ah, thanks so much for the fast reply. I added that code, but still nothing shows up.
I looked up CURL in my webhost’s wiki and it seems like something might be disabled.
Paul Robinson
You are using Dreamhost? Bizzare. This site & the site with the Twitter Stream demo on are both hosted on Dreamhost & both CURL and Twitter Stream works fine… I’m really not sure what is going on.
Could you please find the following line.
Change it to this.
If that works can you tell me what the output is. You may need to do it quickly & restore the code back to normal as quickly as you can as if it works it will produce a fair amount of messy output which you probably won’t want showing on your site.
Let me know what you get. Again I’m really not sure what’s going on but I’ll keep trying my best to solve it. 😉
Paul Robinson
Also just to let you know I’ve just visited your site & I’m seeing tweets now. If you can let me know how you fixed it, it could come in handy for anyone else who has a similar problem.
Dave
Thanks for the great plugin – my last twitter plugin died on me so i was looking for a replacement.
Unfortunatley I just installed it and getting the message:
Your Twitter stream could not be collected. The most probable reason is that Twitter’s API is unavailable or your website has exceeded the API limits imposed by Twitter.
And now I’m thinking… i am on a shared server. I wonder if somebody else on my server is abusing twitter- the api limit is tied to the server’s IP address right?
Paul Robinson
It is yes, but even on a shared server (like mine is) it’s quite hard to hit the limit. I’ll see if I can come up with some way to tell if you have been banned. That message normally means that the response the plugin is getting isn’t valid , if your server IP hasn’t been banned. I’d you can use the instructions in my comment above to find out just whatt is being returned then I’ll be able to help a lot more.
Dave
So I tried that, but I moved the commands up to right after
@$twitxml = simplexml_load_string($content);
Because it wasn’t triggering in the other location.
It showed; bool(false)
so it seems that $twitxml is completley empty.
I did check the httpd error log on my server and didn’t see any errors.
Paul Robinson
Very strange. I’ve never come across a time when
$twitxml
will be false.I’ve just updated the server with a new version, with a lot more verbosity when it comes to errors so if you can update & try again it may shed some more light on the problem. I’ve also added a API limit check so that should solve whether or not you have hit the API limit or not.
If that doesn’t help you could try moving the code above the
$twitxml
line & changing it tovar_dump($content)
as that contains the info before it is parsed.Sorry for the problems & thank you for helping debug the problem. Without help from people like you this plugin wouldn’t work, so thank you. 🙂
Dave
Thanks Paul, no problem, I don’t mind doing some troubleshooting – I used to do tech support for a living 🙂
I updated the plugin and now it is saying:
cURL failed to retrieve any results.
Your Twitter stream could not be collected. Normally this is caused by no XML feed being returned. Why this happens is still unclear. 🙁
I’m starting to suspect it’s something with my sever? It is a VPS that is fully managed by me, so it’s entirely possible I broke something.
Paul Robinson
Hmm. I use a check to see if cURL is installed. The check is to see if
curl_init()
exits which would normally suggest that cURL is installed. Either cURL isn’t installed & for some bizzare reason it’s thinking it is or cURL is broken.You could try running a blank PHP file with
phpinfo();
in it to see if cURL is on the list. You could also try adding$method = 'fopen';
or if that doesn’t work$method = 'socket';
to just above the call totwitter_stream_connect()
inside the plugin. That will force it to skip using cURL & use an alternative method.Let me know if that works & I’ll try and see if I can come up with a reason for cURL failing.
Again thanks for the help with the debuging. 🙂
Jérôme
Hello Paul,
I have the same problem as Sean : nothing is showing up.
I did add the line
echo ‘Unable to open a connection to Twitter. Ooops!’;
and still nothing.
Then I added
print ”;
var_dump($twitxml);
print ”;
And got this :
object(SimpleXMLElement)#3434 (2) {
[“request”]=>
string(49) “/statuses/user_timeline/noodlesninja.xml?count=10”
[“error”]=>
string(74) “Rate limit exceeded. Clients may not make more than 150 requests per hour.”
}
Maybe it’s because I’m on a shared server.
Just in case, I deleted the WP to Twitter extension which was installed but deactivated.
I’ll see how it goes…
Paul Robinson
Yep that message is unfortunately because the server you are on has requested stuff from the twitter API too many times. I am currently adding in a error system so that it will display the error returned from Twitter instead of showing blank.
From looking at the twitter API documentation it seems that if you provide both your username & password it will limit your requests based on your username rather than your servers IP address. So I may try and add in authentication. Also I misread the API and the API request limit is 150, 20,000 is for whitelisted IPs approved by Twitter. 🙁 Sorry.
Jérôme
OK. My tweets did eventually appear (but then I removed the widget from the time being) so I guess it would work but delays are to be expected. An authentification would be a good workaround.
Also an option to avoid showing the @replies would be interesting (or an option to show only the tweets with a specific tag such as #wp).
But then your plugin will start to lose some of its simplicity…
Paul Robinson
Yeah I’m trying to keep it as simple as possible, however it’s bound to end up becoming complicated code wise. I just want to try & keep it’s functionality simple.
It would be possible to not show @replies, however it would be difficult to deal with the fact that you would have less tweets after removing the @replies than you requested. #tags would be difficult too. I’ll put them on my feature list though & see what happens. 😉
I’ve just uploaded the new version with authenication added, if you provide a username & password it should use your accounts API limit (which is still 150, I believe) however it won’t be shared like your servers IP is. The cache should stop you from ever running out of user API requests though.
I’m just about to add instructions to the post to explain how to use authenication, but if you are using the widget & not the template call it’s really as easy as putting in your details. 😉
Hope it works for you. 🙂
Kelly
I am *very* new to WordPress and have never used PHP before. My theme is not widget enabled unfortunately so I can’t use the widget.
In the instructions it says to put in the PHP code. Where exactly do I put it?
Also, once that’s in there and working, where on my site will my Twitter feed show up?
Thanks!
Kelly
Kelly
Oops, it delete the piece of PHP code, but anyway – the piece where I specify my username and # of Tweets to show – where do I put that snippet?
Paul Robinson
Hi, Kelly.
It’s ok I know which code bit you mean. WordPress is a little temperamental when posting code in the comments.
It is different for every theme, but the basic instructions are the same. Open both your website & the WordPress admin so you can switch between them. In the WP admin go to appearence->editor. If you want it to show in the sidebar and the theme creator has been sensible you will need to open
sidebar.php
. Then find where you want the your tweets to appear & place the PHP code you are talking about. Press update & then go to your other page with your website open in it and refresh it to see where your tweets have appeared.Hopefully that will help you. It’s kind of a crash course, but if you need any more help with that & with WordPress in general you could try wordpress.tv where they have lots of video tutorials showing you how to use practically everything inside WordPress.
Kelly
Hi,
I put it in the right place, but now I’m getting the error “Rate limit exceeded. Clients may not make more than 150 requests per hour.” Any fix for that?
Thanks for getting back to me so quickly!
Paul Robinson
The error suggests you are on a shared server. Shared server means there are lots of people on the same server as you (I am also on one). Shared servers are common unless you pay a lot for a private server.
Being on a shared server means that Twitter’s 150 request limit is spread across the entire server, meaning anyone else using a similar twitter application uses the same 150 requests as you.
To get around this you have to log in to Twitter’s server so it counts your API requests and not the servers. You do that by changing the PHP command slightly.
The function must contain all the sections or it won’t work. If you don’t know, the first is the username, second is how many tweets to pull back, third is if it should show the time it was tweeted & then your username & password.
I hope that helps. If you are still confused let me know I’d I’ll help as best I can.
Kelly
It seems to be working now. I’d rather not include my password in code that could potentially be hacked, so I’ll just live with it like this. Thanks!
Paul Robinson
No offence meant but it isn’t really possible for someone to get the password. It would be written on the template page in PHP which is parsed by the server before the page ever reaches the end user.
The best example is the fact that your MySQL database password (which holds all your WordPress data) is written in plain text on line 25 of wp-config.php. That is completely safe as it is impossible for someone to see that unless you give them FTP access to your server.
Saying that it is up to you, I just thought I’d try to reassure you that it is not at all harmful & is not stored in anyway to be hacked.
Jérôme
Wow… That was one very quick update. (^_^)b
Thanks Paul, it is working fine with the 1.2 update and using my twitter password in the widget.
I’ll now need to tweak the CSS before activating it again…
(BTW maybe you should delete that first comment from “Cure Internal Hemorrhoids”, seems like spam to me)
Paul Robinson
No problem. 🙂
Thanks for that, I meant to spam it ages ago and never got round to it. Tricky blighter got past Akismet. Those spammers must be getting cleverer.
Sean Duran
Hey Paul,
Seems like it works sporadically. Maybe I’m hitting the API limit and it has to wait a while for it to work again or something?
Paul Robinson
If you’ve updated the plugin & you were hitting the API limit it should show a message saying you’ve hit the limit. If you have updated & it’s still happening, I’m out of ideas. 🙁 I’m on dreamhost & don’t have any problems running the plugin.
Sean Duran
Yep, looks like we’re hitting the limit. Is that from visitors or the plugin itself?
Paul Robinson
It’s probably neither. If you are on a Dreamhost shared server it will probably be due to other people on the same server as you using Twitter API requests. You have to remember that it’s 150 requests for the server’s IP address, so it’s counting all requests from all users on the entire server.
If you want it to count only your own requests, you would have to log in to Twitter using the new authenication option I’ve put into the plugin. Twitter then counts API requests against your username, which is still limited to 150 per hour, instead of the entire server. As the plugin caches API requests for 30 minutes you’d probably never hit your user API limit.
Sean Duran
Entered our passwords, I’ll let you know if we get the rate limit error anymore.
We’re also randomly getting this error: “Your Twitter stream could not be collected. Normally this is caused by no XML feed being returned. Why this happens is still unclear. :(”
Thanks again!
Paul Robinson
Well as it says unfortunately I haven’t been able to find the cause of that error yet, and since it seems to be near impossible for me to replicate I doubt I’ll be able to figure it out yet. I’ll keep working of trying to fixing it though.
Justin
Love the Plugin; however, I would like to use my PHP file on Thesis Theme 1.6 to insert Twitter-Stream anywhere I want on my page. Is there a way to do that?
Paul Robinson
I’m not sure I understand as I haven’t had much experience with Thesis… If you could elaborate a little I’ll try to help you as much as I can.
P.S. If you mean can you get Twitter Stream to show up anywhere in a PHP file then yes by using the function written in the post above.
Bryon Powell
I love the simplicity of your Twitter plugin; however, I would love to insert a visual divider between each tweet such as found on Medibolism. How would I do that?
Thanks!
Paul Robinson
Hi Bryon,
The divider was done via CSS. Each tweet is inside a <p> tag and all of the tweets are inside a <div> with the class twitter-stream.
On medibolism it is done by adding a bottom border to the paragraph tags. So the CSS could be:
That would add a black dashed divider like the one on Medibolism. The padding just adds some space between the border & the end of the tweet.
Hope that helps. 🙂
Bryon Powell
Many thanks, Paul. I’m still very much in the learning phase and did not know I could modify paragraph borders. After some playing, I’ve got the separators working on my test website: http://www.irunfar.com/wp/ .
Paul Robinson
Not problem, I’m glad I could help & teach you something at the same time. 🙂
Also thank you for the donation towards the site hosting. It’s greatly appreciated. 😀
Albert Johansson
Perfect Twitter plugin, simple and clean. I would love it even more if the time could be translated to the active wordpress language, in my case; swedish.
Is this going to happen? I would love to help out if that is necessary.
Paul Robinson
If you have any experience with i18n within WordPress I would love your help. I have next to no knowledge when it comes to i18n other than
__()
&_e()
.So if you can provide any help, yes I’d love to add language support. 😉
Paul Robinson
Hey,
Just wanted to say I’ve managed to wrap my head around i18ning the plugin & it’s all done, I hope. I’ve updated the plugin & provided a swedish po file with it. If you could fill it in, as I don’t know anyone else who speaks Swedish, and then email me a copy back it would be amazingly helpful.
Let me know if there are any problems & I’ll help out as much as I can. 🙂
P.S. Just in case you don’t know, you can edit po files using PoEdit.
Albert Johansson
Thank you! Extremely good response! I will take a look at it tomorrow.
Thanks again!
Paul Robinson
No problem, I’ve been meaning to start learning about internationalization within wordpress plugins.
Thanks for translating I would have the first clue how to translate into Swedish.
fruityoaty
I get this error (I’m using widget, not PHP code to display):
No user information was returned. This normally happens when you have used an incorrect or invalid username.
The above error happens when I try to show 1 TWEET, even if I entered correct username. However, when I set widget to show 2 TWEETS, the error will disappear, but ONLY 1 TWEET will be displayed. If I set it to show 3 TWEETS, only 2 TWEETS will appear. Always, 1 less it seems.
Paul Robinson
Hmmm very strange. The only problem like you’ve described that I have managed to come across is a quirk of Twitters API. However what you have described isn’t what that quirk does, normally if you have a small amount of tweets & say 1 is an at-reply you end up with that tweet missing as Twitter filters them from it’s user timeline API. If you have a large amount of tweets (which I assume you have) then it doesn’t affect you as you have enough normal tweets to counteract the missing one.
The problem with this bug is that in my code I don’t have any code that counts the tweets, Twitter does all that before hand. So any problems with that should be coming from Twitter. Just to be safe though I’ll look through the code & make sure there isn’t anything amiss.
Paul Robinson
Just another little message to let you know I have checked out Twitter Stream & I can’t, no matter how hard I try, get it to replicate the problem you are experiencing. I have also pulled your Twitter timeline into the plugin on my localhost (since you have your tweets public) and I got the correct amount of tweets as I asked for.
Since the counting is done by Twitter & not my plugin I’m not exactly sure what is going on. You can test the URL that the plugin uses if you like. It’s
https://twitter.com/statuses/user_timeline/username.xml?count=n
where ‘username’ is your username, and ‘n’ is the number of tweets you want.If you can think of any other reasons it might be doing that please let me know & I’ll see if I can help any more. Sorry that I haven’t been much help.
Hesky
Finally found a twitter plug-in that gets the IDs of each tweet’s permalinks correctly! Nice one! I love it!
I want to say thanks and also want to suggest 2 little functions:
1. Add an option that links to the @replies/mentions/RTs
2. Add an optional link to the twitter profile page at the bottom of the widget. It will be ideal if the text is customizable and there is some css classes for styling.
Paul Robinson
No problem. I aim to please. 😉
As for you feature requests, I love ’em I’ll add them sometime today if I can. I’ve been really busy lately, but I’m sure I can squeeze them in sometime today. 😉
Thanks for your kind words & look out for that update later today, hopefully. 🙂
P.S I can add a link for at-replies/mentions but RT are removed from the API timeline by Twitter and therefore will never appear. I believe it is to save resources on Twitters end although I could be wrong.
Hesky
Awesome, thanks.
Paul Robinson
Hey, I’m just a little confused by what you meant by a link to @replies/mentions… As there is already a permalink on the date, where would you like the @replies/mentions to link too?
I’m adding the second request now, I just need to check what you mean by the first request.
Hesky
e.g. http://twitter.com/SuButcher/status/7994423913 it has a “mention” @tepilo
Paul Robinson
Yep so the @reply links to the user profile of the user you are replying to. I’ve added that & I’ve also added a link around #tags to a twitter search for that tag.
It should be available for update now, unless WP’s plugin server is having one of it’s slow days. 😆
Hesky
That’s ideal to me. I’m looking forward to it! Thanks for the great work mate!
John
The plugin don’t work with the new Twitter Retweet funktion. It displays “No user information was returned. This normally happens when you have used an incorrect or invalid username.” if there is a tweet in the new retweet format.
Paul Robinson
Hi John,
That isn’t actually a problem with the plugin. All retweets are stripped by Twitter’s API before the plugin ever recieves them. There is a way to merge them, but only if you authenticate a user with Twitter & not everyone is willing to do that. So for that reason I have not added retweet merging.
It does however cause a problem where by if you request 10 tweets & 9 of them are retweets Twitter doean’t auto correct & give you 10 standard tweets, it gives you 1. I am currently working on a fix for this problem, but as it’s Twitter’s API that makes the mistake it’s very difficult to fix.
Hope that helps.
John
Hi Paul,
thank you for the quick response.
I try to request only 1 tweet (the last one) and if this is a retweeted tweet (= created with the new retweet funktion) I get the error message “No user information was returned. This normally happens when you have used an incorrect or invalid username.”.
Paul Robinson
Twitters API doesn’t return retweets in it’s standard API requests. It requires special coding and authentication from the user. Since not everyone wants to authenticate themselves I have left this option out.
The reason you get that error is because if you ask the Twitter API for 1 tweet and the last tweet you did was a retweet it will still count it as being a tweet but it will then be filtered out by Twitter before returning them to the plugin. It can be difficult to understand and first and I am trying to find a way around this problem but so far I haven’t had any luck.
I am considering adding retweet support as an optional feature in the next version.
Scott Faust
I just started using Twitter not too long ago, since then I’ve begun to love it. What started out as a hatred for Twitter it’s allowed me to network with people in my business alot easier. News and updates happen in quickly which makes for a great social communication app.
Katie
Love the plugin! Can you tell me how to edit the “Visit My Profile” text? I want it to say something else. I think you sort of explained how to do this, but I need the directions spelled out a little more clearly. Thanks!!
Paul Robinson
Hey Katie,
If you are using the widget then you just write the text you would like in the last field in the widget options. If you are using the function call you would have to write something like:
change the last bit to customise the text. Just remember to change the options to whatever you have set, so replace
mytwitname
with your username,20
with the amount of tweets to get,TRUE
with whether you would like the date shown or not (true or false),FALSE
if you don’t want to log in to twitters servers & then the text for the profile link.Hope that helps. 😉
Katie
Well I feel sheepish! Thanks for pointing out the quick and easy answer, Paul. Love your plugin, especially because it doesn’t overload my shared server with API requests 🙂
Paul Robinson
No worries Katie, it happens to all of us. Glad you like the plugin, and let me know if you have any requests or any thing. 😉
Richard
Is there a way to include the re tweets in the time line?
Paul Robinson
There is, but it would require a bit of a code re-write. I am planning to add it soon, but it requires the user to authenticate themselves to Twitter.
I’ll try to add a section in soon where you can choose whether to login to Twitter & receive retweets.
Sorry.
Jon
This is such an invaluable plugin — really, as a customer/sometime-victim of shared hosting, so few Twitter WP plugins “get” the need for solid authentication, and this nails it. That said, the only thing holding me back from being able to across-the-board recommend this as a 100% viable plugin for my clients’ needs is the lack of a feature for hiding @reply tweets (it’s a common/growing desire). Any guess/ballpark when this might be included? Again, great work, and thanks for providing it!