My Blog Guest

How to Create a Useful Twitter Retweet Bot

Create Twitter RT botTwitter can be used in various, almost countless ways. In this post I am sharing a tip on how to create a useful Twitter RT bot that can be used to collect various Tweets around a keyword or a hashtag and retweet them. And before you start throwing stones at me calling me a Twitter spammer, let me give just a few examples of how this bot can be used to create real value:

  • Think of a Twitter RT bot that will be used to collect Tweets around some SEO conference. Thus all people who want to follow live updates from many members won’t need to keep track of hashtags and keywords associated with the event – all they need is to follow your bot.
  • Or, say, you want to introduce your own cool hashtag and get other people to use it (#FirefoxFriday for example) but you want to filter out all retweets and give people the way to only follow real first-hand Tweets – a Twitter bot is the best option to go!

So, I guess I made it clear why you might find this tutorial handy. Now let’s see how to create one:

Create a Yahoo! Pipe

1. Choose the keywords / hashtags to retweet

Once you decided to create a Twitter bot, I suppose you already have the topic. So what you need to do now is to create a new hashtag to filter the Tweets (or just use the one you want to retweet);

2. Use Yahoo! Pipes to create a feed

The reason I use Yahoo! Pipes to create a feed is that Twitterfeed (I am going to use to auto-tweet) does not allow to use Twitter-based feeds and also Yahoo! Pipes offer some cool options allowing to customize the feed. So:

  • Now, go to Yahoo! Pipes and click “Create a pipe”. Drag the “Fetch feed” item from the left-hand panel and provide your Twitter search RSS link. You should see the feed output at the bottom of your screen.

Twitter  bot: fetch RSS

  • Filter your feed. Now, there might be plenty of retweets of the initial Tweet using your key hashtag – and you don’t want your bot to repeat one and the same update again and again. So you can go ahead and filter out all Tweets containing “RT” ( “Retweet”, “Retweeting”, etc):

Drag the Operator > Filter pipe from the navigation and add the following:

Twitter bot: filter

Now, connect all three pipes (feed, filter and output) together and you are done!:

Twitter bot: connect

  • You can also give credit to the initial update author (RT @username) for the bot’s update to look like this: [the initial message here RT @tweet-author]. This part is a bit more complex.

1.First, drag Operators > Loop Pipe and insert it before the “Pipe output” Pipe;

2. Now, drag String > String Builder Pipe right in the middle of the Loop Pipe and do exactly what is shown on the screenshot:

Twitter bot loop

You should see now that the feed output contains the URL to the initial author profile:

Twitter bot loop

3. Now you should cut the first part of the URL and make it @author. For that grab Operators > Regex Pipe and there in item.title replace with RT @

Twitter bot replace

(!) Don’t forget to connect the last pipe with the other ones – so that in the end our Pipe looks as follows:

Twitter bot - Yahoo! pipe

And the output looks like this:

Twitter bot: output

Save the Pipe and grab its RSS.

Set up the Auto Tweets

All what follows is quite easy:

1. Create your new Twitter profile to publish the Retweets,

2. Connect it to Twitter Feed and set up the auto-retweets there:

Twitter bot: TwitterBot

Congratulations! You are done!

Can you think of any really creative uses of this tip? (Please don’t spam Twitter!)

The following two tabs change content below.
I am the owner of this blog and founder of
  1. 102 Responses to “How to Create a Useful Twitter Retweet Bot”

  2. Yahoo! Pipes is an amazing tool. Great post!

    By Tanner Hobin on Nov 12, 2009

  3. Great use of Yahoo Pipes. I’ll give it a try later. Thanks for sharing it!

    By Blog on travel on Nov 12, 2009

  4. I came across this a while ago and I’ve been meaning to test this to see how helpful it is retweeting potential link partners tweets for aquiring links

    By Leo Fogarty on Nov 12, 2009

  5. Sounds interesting, gonna give it a try in the morning.

    By Gareth James on Nov 12, 2009

  6. I don’t understand how you can be a twitter spammer. Spam is unsolicited. if you follow someone’s twitter feed, then by definition you have solicited that person’s tweets. ??

    By Jenny Talia on Nov 16, 2009

  7. Even if your not following someone and they mention your @username in a tweet you’ll get it in your “mentions @username” thus spamming you

    By Leo Fogarty on Nov 16, 2009

  8. ah. but it is still solicited. it is how the system works. you get tweets directly from the person you want to read and you get retweets. as a subscriber, it comes with the territory.

    meanwhile, twitter needs to allow users to filter out retweets/mentions @username to give users more control over the experience.

    By Jenny Talia on Nov 16, 2009

  9. Very useful tips. I have been using Yahoo Pipes a long time ago but not yet tried on this. Thanks

    By Tinh on Nov 16, 2009

  10. I took the plunge and logged into yahoo pipes and tried this myself. Your instructions were perfect. I can now RT on any topic I want.


    By Richie on Nov 17, 2009

  11. Hey ! Thanks a lot. This is interesting and it seems very useful I am going to try it, for sure.

    By Anne Ross on Nov 18, 2009

  12. Be patient on the Twitterfeed step.

    Twitterfeed has known connectivity issues with Yahoo Pipes. If Twitterfeed says it can’t validate the feed, just try again until it can. 😀

    See this thread for more info:

    By Hendy Irawan on Nov 19, 2009

  13. Not only I was given Captcha, the SK2 also given PHP errors:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/content/a/n/n/annsmarty3/html/wp-content/plugins/SK2/sk2_second_chance.php:2) in /home/content/a/n/n/annsmarty3/html/wp-content/plugins/enhanced-wp-contactform/wp-contactform.php on line 264
    Thank you. Your comment has been approved.

    By Hendy Irawan on Nov 19, 2009

  14. Hey Hendy, no idea what the problem with SK is. Usually it works pretty well. Sorry for that.

    And thanks for bringing that issue to my attention.

    By Ann Smarty on Nov 20, 2009

  15. HI

    Twitter is one of the best site where we can do marketing and it return the credit in the shape of visitors.

    By Web Marketing Services on Nov 23, 2009

  16. This is very interesting and useful. Thank you….

    By Loren on Nov 25, 2009

  17. Your article about Twitter Retweet Bot is very interesting… Thanks for the information…

    By Fajardo on Nov 25, 2009

  18. I like your instructions very much. I’ll try to create my own twitter bot soon.

    By Nikita Sumeiko on Dec 18, 2009

  19. Same article I saw somewhere with yahoo pipes & twitterfeed

    By Athul Jayaram on Dec 30, 2009

  20. I was looking for this type of information. Thank you.

    By Allen on Dec 31, 2009

  21. Great and useful article! Am using Google URL Shortener integrated in Google FeedBurner! It’s better and more real-time!

    By Yadhav on Jan 1, 2010

  22. I get a (503 Service Unavailable) for the feed… Has anyone else got this and know a fix for it?

    By sapp on Jan 10, 2010

  23. yeah, 503 error all day, yo. what up with that? anyways, every few hours it looks like something gets through, but for the most part, 503

    By matt on Jan 11, 2010

  24. Hi Ann, just checking out your blog, fantastic tutorial here. One thing that I think may be missing here is creating blog posts from this piped and aggregated content, then sending to Twitter.

    Despite what others say about automating Twitter Tweets, I believe I read somewhere that 70% of all Tweets are bot-generated anyways, so there’s no harm in doing this in my opinion.

    If Yahoo Pipes creates an RSS feed that TwitterFeed can work with, then a blog running WP O Matic or FeedwordPress could aggregate that same RSS feed, and post the pulled content as a draft.

    You could then write a few sentences introducing the source of your information, then link to source, then publish your blog post.

    Then TwitterFeed will pick up your blog’s RSS feed (more reliably than a Yahoo Pipes feed) and send it on to Twitter.

    This method allows you to add content to a semi-automated blog, giving your more and more indexed pages and the crux of what you were trying to do (gather together info on a certain topic) has still been achieved, just in 3 places instead of 2 (Yahoo, Blog, Twitter, versus Yahoo >Twitter)

    You could also use Delicious Tags to create RSS feed for whatever url you want and your Delicious Tags go into a dofollow RSS feed which could be sent to a semi0automated blog then to Twitter etc….

    I wrote about Delicious links here on this post



    P.S. Going to spend rest of day doing SEO brain games, thank you very much! :)

    By Daiel McGonagle on Jan 20, 2010

  25. thanks .. a great info

    By party on Jan 22, 2010

  26. How could I change this to reply to the person that tweeted rather than retweet them?


    By Mark on Feb 1, 2010

  27. There are thousands of pipes already available for mash ups. I’ve noted some of the unique and best pipes for everyone to use.

    By Mayur on Feb 20, 2010

  28. I have to ask, as it isn’t obvious from your post. Can you create a bot that retweets multiple phrases? I have set up a test ot using your principles, but can I get it to retweet various hashtags or searches? If it’s possible then what is the easiest way to do it?

    By Synonymous on Mar 4, 2010

  29. @Synonymous, all you need to do is to create multiple Twitter search feeds, like I did in this post:

    By Ann Smarty on Mar 4, 2010

  30. This is great for filler to your accounts between your actual tweets. Not an end all solution, but I dont think it was intended to be. Thanks again.

    By axzm on Mar 18, 2010

  31. Thank you very much for this tip. As i am new in internet world, so it must help me.

    By Free Classifieds Ads on Apr 7, 2010

  32. Um, funny, looks exactly like my post on it a few month before yours:
    Thanks for the mention

    By xavierv on Apr 30, 2010

  33. Looks exactly different to me…

    By Ann Smarty on Apr 30, 2010

  34. How do i get a space between the “RT @username” an the following text ?

    By Dominik on Jun 8, 2010

  35. Just set up a RT-Bot. Thank you very much. :)

    By Cruelty on Jun 14, 2010

  36. Still not knowing how i get a space between RT @username and the following text while using this bot ???

    Can anyone help ?

    By Dominik on Jun 16, 2010

  37. @Dominik

    The textfield in the middle must contain a space.

    By Cruelty on Jun 16, 2010

  38. In the Loop -> Stringbuilder

    By Cruelty on Jun 16, 2010

  39. Great tutorial I’m using it now – works like a dream.

    By KillerQuaid on Jun 20, 2010

  40. @Dominik A better solution to the space problem:

    1. Get rid of Loop -> String Builder.
    2. Change the Regex to “In item.title, replace ^([^\:]+)\: with RT @ $1.”

    (The $1 is a variable that isolates the Twitter handle. In my tests, the rest of the status was included with a space but it would be simple to fix with an extended regex if it wasn’t)

    By David Merrick on Jun 20, 2010

  41. thx a lot !

    By Dominik on Jun 22, 2010

  42. Edit to my comment above–Step 2: “In item.title, replace ^([^\:]+)\: with RT @$1.” (I’d accidentally put a space between “@” and “$1”)

    By David Merrick on Jun 22, 2010

  43. I have to ask, as it isn’t obvious from your post. Can you create a bot that retweets multiple phrases?

    By Etalaze on Jul 9, 2010

  44. Hey great info! It helped me to create a RT bot of my city’s tweets.

    I wonder if you can help me to create a pipe that can extract only the hashtags of a twitter feed, i want it to get the trending topics for my country.

    By Jaime on Jul 24, 2010

  45. @Etalaze: Totally. Just use the Union operator to aggregate the phrases you want to retweet, then filter them with the Unique operator before you output them because you might end up with duplicates.

    @Jaime: You could do that with a different regular expression to filter out the hashtags.

    By David Merrick on Jul 24, 2010

  46. I was trying to make a retweet button but failed. Now i found this post here. Thank you very much.

    By Puppy Training Tips on Jul 30, 2010

  47. Thanks! Very useful… but what to do to make that ‘RT @username’ appears at the begining of the tweet?

    By Rufino on Sep 17, 2010

  48. Thanks for this great tutorial. How can I make sure that the tweet (incl RT @orgtweeter) has a max of 140 chars?

    By bitas on Sep 23, 2010

  49. i can publish my pipe output to Twitter Feed.
    it dont take the rss of pipe output

    By atul jain on Oct 7, 2010

  50. Hey, just wondering how to filter out duplicate @ Mentions. For example, if I’ve already retweeted someones post mentioning ‘ipad’ and they mention ‘ipad’ again, how can I filter out their later posts to avoid @ Mentioning them over and over again. Please let me know. This would be a useful filter.

    By GeoAgent on Oct 26, 2010

  51. Saved my day. Thanks for the post. Helped me a lot.

    By Thomas on Oct 28, 2010

  52. Followed these instructions and it does seem to work. The problem is that it retweets the entire feed and not just new tweets, which I was afraid might be the case. I am trying to set up a retweet stream for followers to use a specific hashtag to communicate community news and info. For instance they want to notify of a traffic accident to avoid, tweet the location using the hashtag and that is retweeted. Not continually retweeting older messages. Any ideas? Thanks!

    By Connie on Dec 4, 2010

  53. Hey, I’m trying to create a string like this:

    RT @

    I can ‘t get the to work, the message gets stuck together with the author name, can you help out?

    RT @jonnyhey wtf is going on #wtf

    The correct what should be

    RT @jonny hey wtf is going on #wtf

    By Bemm on Dec 20, 2010

  54. Thanks for the effort but I think there’s a much better way to do that. There are some sites offering this kind of service as far as I know. What you’ve shared is helpful but it will eat up more time.

    By dee oneal on Dec 22, 2010

  55. You do need a lot of coding knowledge to create a proper bot right?

    By Outdoor BBQ Grills on Dec 29, 2010

  56. I’m wondering if twitter search feeds have changed since this was written — I’d love to implement what you’ve outlined, it’s exactly what I want, but I can’t get the twitter search feed to work — no activity displays when I click “refresh” in your very first steps, no matter what feed I try. When I subscribe to those same feeds with google reader, they show up fine.

    any help?

    By amy on Mar 11, 2011

  57. @Amy, Twitter search hasn’t changed. Maybe a temporal bug in Yahoo! Pipes? They are quite buggy recently. Maybe lack of funding…

    By Ann Smarty on Mar 14, 2011

  58. This is really very useful post. Thank you.

    By Web Design Stuff on Mar 14, 2011

  59. Works like a charm! Easy to alter to my needs. Thanks!

    By Jorgen on Mar 15, 2011

  60. This isnt working, Says that the RSS isnt valid. I wonder if this: has something to do with it. I know twitter had a huge argument about bots spamming them….

    By Sheffield Website Design on Mar 16, 2011

  61. one question…
    is the retweet IN REAL TIME?

    or is it retwitted every 30 min?

    By alejandro on Apr 1, 2011

  62. Hello Thanks for the post
    How can i block my own tweets i don’t want to be duplicates, i want to find my hash tag from others only!

    By Jay on May 6, 2011

  63. Yahoo! Pipes is awesome tools,thanks for this informative post.

    By Gray Stephen on May 26, 2011

  64. Your post inspired me enough to change my entire social media strategy really, not just twitter…

    Here is how I put to use the tips that you have given here. Create an archive of your tweets, then feed them to google reader, create an RSS feed of the tweets and push it to your twitterfeed account via yahoo pipes (alright you have covered that in your post). The fun begins here, there is a plugin for wordpress called the tweet old post plugin, which randomly sends tweets of your posts to your twitter profile.

    Just make a new twitter profile and push all your posts randomly (1 tweet per hour is the lowest frequency available) . Make a yahoo pipe of that account and use it in twitterfeed to push the hourly tweets to multiple twitter accounts, and before you know it, you are sending 24 tweets a day without looking cluterred and multiplying your twitter reach 24 times at the same time overcoming the global time barrier…

    Furthermore you can set your tweets from the pipe to auto feed to your linkedin account via twitterfeed and multiply your reach that many times. If you are a LION on linkedin then you will see huge value in this strategy. Continuously broadcasting tweets at regular intervals without requiring any other social media management tools like Hootsuite and buffer.

    coz if you have mixed followers, someone or the other will always be online to read your tweets, that way you are also optimizing CTR for links in tweets…

    By Rohan on Sep 19, 2011

  65. I think its no longer available, I can’t fetch a feed using yahoo pipes.

    By Tour Karimunjawa on Oct 4, 2011

  66. Hello, I just have a question as to whether or not this would work for an application I am looking into. I am trying to Retweet all tweets either Tweet’ed by other Twitter handles when mentioning this original handle/account

    ex. @Twitterhandle2: @Twitterhandle1 is great

    so that @Twitterhandle1 RT this.


    for the original Twitter handle/account to RT all tweets mentioning one hashtag

    ex. @anyTwitterhandle man i love this #greatidea

    so that @Twitterhandle1 RT any tweet (worldwide) that includes the hashtag @greatidea

    would either of these work with this RT bot?

    By Patrick on Oct 6, 2011

  67. My Twitter bot fails to add a space between the user name and the content of the tweet. They are all formatted like this:

    RT @UserNameThis is content…

    Should be
    RT @UserName This is content…

    So how do I get a space between user name and content?

    By MP on Oct 25, 2011

  68. Seems twitter no longer allows those RSS feeds for search terms. Anyone know a solution that works with the above solution?

    By Mike on Nov 3, 2011

  69. I just started using Yahoo! Pipes, and at first I must admit, it’s a bit complicated to use, but once you got the hang out of it, it’s pretty cool tool and very useful.

    By AML on Nov 25, 2011

  70. out of date post as twitter does not provide any RSS feeds from any user

    By rahul on Dec 5, 2011

  71. All the RSS feeds are live. They just removed the links but not the functionality:

    By Ann Smarty on Dec 5, 2011

  72. Thanks for reply it was helpful

    By rahul on Dec 6, 2011

  73. Does this still work now that twitter has removed the RSS feeds?

    By Boydie on Dec 19, 2011

  74. I must admit, at first when I made my first yahoo pipes feed, I got overwhelmed and so complicated but once I got the feel of it, I got comfortable and I love using it now.

    By Kelly@ SEO Help on Jan 5, 2012

  75. I’m using a similar technique, but the output of Yahoo Pipes is sent to IFTTT, which pushes tweets into my BufferApp – that way I tweet on a regular, nicely-spaced out (in time) basis, as controlled by Buffer, rather than all at once as determined by when the original tweets occur.

    By Cooper Marcus on Jan 24, 2012

  76. This is awesome! Thank you very much!
    One question though:

    How do I make the “RT @USERNAME: ” appear at the BEGINNING of the tweet?

    By Liam on Feb 22, 2012

  77. Why are you so smart? Is there anything to be done for those of us who were neglected at birth? I can answer security questions, but want to make a hashtag. Many thanks for the new knowledges!

    By Jeffers on Mar 1, 2012

  78. Is there any other way without using TweeterFeed. I dont want sign up for one more account.

    By Pravin on Mar 6, 2012

  79. Hey Ann

    Yahoo pipes is very powerful tool.
    What is the best way to cordially thank someone for a mention without sending a direct message?
    I may give this method a go looks interesting.

    By Kasi Phillips on Mar 7, 2012

  80. Works like a charm! Easy to alter to my needs. Thanks :)

    By Jeremy on Mar 26, 2012

  81. Thank you, but i have this error messege at twitterfeed: “Your feed might be empty or missing publish dates or GUIDs. A feed needs to contain publish dates or GUIDs in order to work with twitterfeed, see help” :( some solutioN?

    By Rodrigo Córdoba on Apr 7, 2012

  82. The string builder no longer behaves as illustrated. The new version doesn’t add a URL – instead it adds both the and the (Twitter Name). I can’t figure out on my own how to convert that back to @username. Please update.

    By Dave on Apr 17, 2012

  83. @Rodrigo I have the same problem! Apparently the feed that Yahoo Pipes gives us doesn’t have publish dates. I’m stuck. Help, anyone?

    By Pabs on Jun 19, 2012

  84. Thanks for providing information on how to set up Twitter retweet bot. it is always good to set it in auto retweet mode so that the update happens without the need for manual tweets.

    By FeliciaCorrine on Jun 27, 2012

  85. I created a Twitter Bot Script to easy establish a Retweet Bot.

    Much easier then with Yahoo Tubes :)

    Fell free to use!



    By Manka on Jun 28, 2012

  86. Question, when the retweets go out, do they include the actual twitter account they are referencing or do they just say who it’s from.

    @demoaccount or
    demoaccount: (then the retweet)

    In other words, will the account you are retweeting know you are retweeting them?

    By dave on Jul 16, 2012

  87. @dave: The question is for me?
    If yes: Yes, the account will be notified, that someone has retweetet.

    By manka on Jul 16, 2012

  88. How can i put RT @USER at the end of post?

    By Rodrigo on Jul 17, 2012

  89. Using Yahoo pipes is an option, but to me it’s somewhat complicated and not that flexible. There are already working services like RoundTeam — . It provides a lot of auto-retweet options for free, and is very easy to use.

    By Oleg on Aug 5, 2012

  90. What’s the best way to prevent errors using Yahoo pipes?

    By Kasi Phillips on Aug 8, 2012

  91. Why do you need Yahoo pipes if there are already dedicated free online serices for automatic retweeting, like RoundTeam

    By Oleg on Aug 8, 2012

  92. Yesterday, i used roundteam to retweet some hashtags and mentions. I got 125 retweets in 1 minute time. I got warned by twitter that my daily tweet limit has been exhausted and try after some hours. Is there any retweet control setting on roundteam? If not then it would be very difficult to escape Twitter’s ban or warnings.

    By Justin on Aug 23, 2012

  93. If possible, please tell a few words about your use case. Why do you need to retweet so popular topic (which generated hundreds of Tweets per minute)? Can regular search be used for this purpose?

    One thing, IMHO, is to retweet carefully. Of course, if I configure to retweet “Bieber” from all Twitter, my account will get blocked in seconds. But the other question is, do I really need to do that? Retweet services should not substitute/compete with regular Twitter search. RoundTeam, in particular, is positioned as Community Building Tool for Twitter, hereby encouraging to retweet “from followers” by specific hashtag/mention/keyword. Or to aggregate Tweets by specific topic from several accounts while using “retweet from following” or “retweet from lists” features. Typical example is news aggregating, but there are a lot more I can think of. Retweet “from all Twitter” is typically used by less-known companies for self-promotion purposes, they are obviously interested what Twitter is telling about them.

    The other thing is, sometimes community (followers) may generate huge amount of tweets of same topic (same hashtags) in seconds, so being retweeted by Team account, this account will get blocked.

    I agree, this is something they should think about. I suggest to write them an email to — they have pretty good email support. At least my several requests were solved or responded in less than 24 hours.

    By Oleg on Aug 28, 2012

  94. The have changed the rss at twitter is there another to do this ??

    By Michell on Sep 4, 2012

  95. Thank you for sharing it. I’m trying to create a string like this.

    By Taswir Haider on Jan 21, 2013

  96. Thanks for sharing this. It’s really useful!

    By Jessica on Sep 4, 2013

  97. Is it possible to use this to retweet a person and not just a certain keyword?

    By Kyle on Jan 27, 2014

  98. @Kyle, yes it’s possible with RoundTeam, see here:


    By Oleg on Jan 29, 2014

  99. Hi there,

    You can actually just use a retweet service like that allows you to send curated Tweets, Retweets and Favorites on autopilot.

    We’re currently in Private Beta so if any of you guys want to sign up visit the site!

    Thanks guys

    By Askin Akhan on Aug 10, 2014

  100. This is the great tip to gain quality twitter backlink and also useful to rank high my blog.

    By John Pascal on Oct 28, 2014

  101. I’m a big fan of the Yahoo Pipes tool. Thanks for sharing!

    By Dan on Sep 27, 2015

  102. Thank you for sharing it. Is there any other way without using TweeterFeed? Thanks..

    By Gereggi on Nov 10, 2015

  1. 1 Trackback(s)

  2. Nov 12, 2009: uberVU - social comments

Post a Comment