A simple retweet bot with Yahoo Pipes and Tweethopper
Posted by zwartezwadderneel
This is not an invasive bot, but a little “pipe” bot. And you don’t have to be able to program, just be able to think logically (somewhat). I am making this one for OpPinkPower. She wants to make sure she doesn’t miss #OpIon and #ENOUGH tweets while sitting confused in an obscene amount of information.
The images link to larger, readable images of itself.
- Sign in to your Twitter account
- Sign up and in to Yahoo Pipes
- Sign up and in to Tweethopper and add your Twitter account.
- Sign up and in to Bit.ly. In Account Settings you can find your bit.ly API key. You might as well authorise bit.ly for your twitter account.
Tweethoppers free plan allows for only one job, so we better make that a job worthwhile.
Create Twitter Search Feeds
Don’t make more than three Twitter search feeds that are not too wide, or else you will be drawing too much data too often from Twitter and your account may get suspended, even when you are not doing it to get more followers (Twitter Rules)
Then right-click on the little “Feed for this query” button up top on the right, and from the menu choose the function that copies the link. OpPinkPower will retweet these:
- http://search.twitter.com/search.atom?q=%23ENOUGH+children (One of the anonymiss hashtags)
- http://search.twitter.com/search.atom?q=%23ENOUGH+women (Another anonymiss hashtag)
- http://search.twitter.com/search.atom?q=%23OpIon (Yet another anonymiss hashtag)
Make Yahoo Feed
Go to your tab with Yahoo Pipes. Click on Create a Pipe.
In the new window on the left are a number of grouped elements/functions/objects that we’ll use. Under Sources get a Fetch Feed, and add the Twitter Search Feeds you made.
Under Operators get a Filter and create a link from Fetch Feed to the Filter
Set the Filter to “Permit items that match all of the following”, and using the dropdown box, choose “item.content.content to Contain http:// “
Add another filter and link the previous to this one. Set this Filter to “Block items that match any of the following”, and set:
- item.author.uri to Contain YourTwitterName (you do not want to retweet your own)
- item.title to Contain RT.*RT (exclude retweets of retweets)
- item.title to Contain @ (exclude direct messages)
- item.twitter:lang to Does not contain en (we’ll only retweet english tweets in this example)
Add the strings item.author.uri, item.y:published.year, and item.content.content, and assign results to item.title.
The String builder only uses predefs and has none for a space, so the middle one, item.y:published.year is part of a workaround to create a space where we want it later (see below).
Get a RegEx from Operators. Ye need two:
- In item.title replace http://twitter.com/ with RT @. Do not forget the second slash in http://twitter.com/.
- In item.title replace 2011 with a space. Not a dash, or \s, 040, or whatever code indicating a space, but a space. Just a space.
Now connect the RegEx to the Pipe Output. That’s it for the Yahoo Pipe Building. Click “save” (up top right) and enter a name for your pipe. Somewhat to the left is a “Back to My Pipes” link, open it in a new tab, click your pipe, and copy the link of the RSS Feed:
Copy the RSS link and use twitterfeed: Making sockpuppet music by retweeting twitter search terms
Add to Tweet Hopper isn’t working yet
Open up the Twitter account you added to Tweethopper and select Add Feed Tweet Job
A little blue link “Add Feed Url” appears on the same page just below the three options. Click it, enter the Yahoo Pipe RSS Feed you have just made, and your bit.ly username and API key, and “Update This Account” at the bottom. You’re done. The Feed-Tweet job runs every 10 mintues. I hope we soon get to have a feature where we can set this (with a minimum time of course).
It may take awhile for the retweets to start happening. And tweets currently still get broken off at a hashtag. I have posted a question in the tweethopper forum (section problems) for that as the Pipe delivers the hashtags just fine.
Existing Pipes are share-able and copy-able, and you can also ask me to make a new pipe for you. I may have time, I may not have time for that. :) And post questions and problems below. I’ll respond. Suggestions for improvement of above guide and pipe is also very welcome. In fact, anything you say and write below will be used for that.
- How To Translate RSS Feeds Automatically With Yahoo Pipes (ghacks.net)
- Combine Multiple RSS Feeds With Yahoo Pipes (ghacks.net)
- “Tunneling Under” the New York Times’ Paywall (zaccohn.com)
- Hacking RSS: Filtering & Processing Obscene Amounts of Information at SXSW (fastwonderblog.com)
Posted on May 12, 2011, in Tools and tagged Advanced Search, Drag-and-drop, Online Communities, Pipes, RSS, Social Networking, The Filter, Tweethopper, twitter, Yahoo Pipes. Bookmark the permalink. 4 Comments.