How to Replace IFTTT Twitter Triggers Now that they’re Gone


New Media Europe 2016 - London


Update- June 2013- Twitter have now stopped supporting their API v1. This means no more RSS and so the method in this article will no longer work. However…. I’ve been working on a new project called Twools. This gives you back your RSS feeds but in vastly superior way. It also has other features such as a very simple social media management tool and an experimental DM spam filter.

Introducing Twools

twools

Twools started off as a way to get back RSS feeds from Twitter. Twitter retired version 1 of their API in June 2013 as well as retiring RSS feeds. As well as not having access to RSS feeds, you need to be authenticated to use the API which raises the bar for Twitter users and developers.

It has been my intention to make this as easy as possible for you install, however you do need to install Twools on your own website (PHP is required). It is just a case of editing a few lines in a file (with your Twitter app details) and uploading to your website.

With Twools you can do some amazing things when used in conjunction with other apps such as IFTTT or Twitter Feed. For example, you could…
Twools Home Page

  • Cross post to LinkedIn using the #li hashtag
  • Bookmark or cross post your Twitter Faves:
  • Add new followers from the a certain country or location to a Twitter list:
  • Add articles that I tweet using a certain app to evernote.
  • Get emailed when someone mentions your brand negatively.
  • Get emailed when someone links to an article on your website even if they don’t mention you.
  • Add someone mentioning a keyword to a Twitter list

Obviously you need to make sure sure you have a proper read of theTwitter API Rules of the Road and use Twools responsibly.

I’ll be launching Twools on Friday July 5th, but for more information, have a look at the Twools Page.


Show me your Twools Tool Please!!

If you are a Twitter power user like me, you may have been dismayed at some of Twitter’s antics over the past year, particularly when it comes to locking down their API. Twitter’s API gives developers an easy way of accessing data- such as public tweets and mentions and using them in interesting and innovative ways. There is no doubt that the API and the developers that used it made Twitter what it is today. I won’t go into too much detail about the changes made to their API, as I’ve already written about it before in relation to the paid for social network, app.net.

Not everyone has the time or the skill to develop apps, but a lot of people wanted to find ways of connecting Twitter with other services. Services such as IFTTT (If This Then That) make such a thing not only possible, but ridiculously easy. I’ve posted frequently about IFTTT, and in particular on How to archive your Digital life. With IFTTT it used to be possible to do all the following:

  1. Archive your Tweets to a spreadsheet
  2. Update Facebook/LinkedIn/Google+ etc with your Tweets
  3. Update your calendar with a tweet
  4. Send a text message when a particular keyphase was used.

Unfortunately none of this is now possible, since IFTTT was forced to remove all Twitter Triggers from their service due to Twitter’s API lockdown. For more information on what happened, you can read this update from IFTTT.

Hurrah for RSS!

RSS

However, do not fear, it is still possible, with a bit of tweaking. The power comes from RSS feeds. An RSS feed is a special feed that you can subscribe to in a programme or app called a feed reader. Examples of apps that read RSS feeds include Google Reader, FeedDemon, SoundGecko and Flipboard.

For example, here are the RSS feeds for my Twitter account, iagdotme:

With the search feed, you’ll have to convert your key phrase into a URL friendly one. That means converting each space into a %20 and each hashtag (#) in to #23. Sorry if that sounds complicated, but hopefully it makes sense when you look at the URLs above.

RSS is Dead!

RIP RSSUnfortunately, despite RSS being a wonderful technology, you wouldn’t think so if you look at Facebook, Twitter and Google+. All three have done their best at burying RSS and sucking all the life out of it.

Although Twitter currently supports RSS, is not going to be supported from March 2013. According to Twitter, XML, Atom, and RSS “are infrequently used today“. I really do wonder what planet they are on!

So, we’re going to be stuck with a special feed format called JSON. Now, unless you are a web developer you’re probably not going to know what that is. JSON is very easy to play with from a web development point of view, but it’s unusable to most people.

Just in case you are curious, here are the same feeds I mentioned above, but for JSON:

  • My Tweets: https://api.twitter.com/1.1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=iagdotme
  • My Mentions: https://api.twitter.com/1.1/statuses/mentions.json?include_entities=true (only when logged in as authenticated user)
  • My Favorites: https://api.twitter.com/1.1/favorites/list.json?count=2&screen_name=iagdotme (only when logged in as authenticated user)
  • Search: https://api.twitter.com/1.1/search/tweets.json?q=Search%20Phrase (only when logged in as authenticated user)

One big problem with the above is that you can’t access the mentions feed unless you are logged in to Twitter as that user.

RSS is Alive, Hurrah!

So, one way of getting your Twitter IFTT recipes back up and running and making sure that they’ll work after March 2013 is to convert your JSON feeds to RSS. You can add the RSS for your tweets to IFTTT or add your favorites. Unfortunately it’s not possible to create a feed of your mentions using this method, as it would require some more complex authentication scripts- and that’s not really my thing.

June 2013 Update – I have finally managed to get authentication working
I’ll update this post as soon as I can (or write up a new one), but I’ve written some PHP scripts that will enable you to produce RSS feeds for:

  • Your tweets
  • Your Mentions
  • Your Favorites
  • Your Lists
  • Your Direct Messages
  • One of your Twitter List timelines
  • Your tweets containing a specific hashtag

It will take me a bit of time to get this all together, but if you are interested, let me know in the comments and I should be able to send something over to you. Please note, you will have to have a web host (for example if you have your own website) with PHP.

I looked at a number of solutions, but there are surprisingly few examples of how to convert JSON to RSS. I looked at Yahoo Pipes, but since Twitter only allows a certain number of calls on its API from each IP address, I found that each attempt failed.

The best way is to run the script on your own web site. Since most websites have PHP enabled, I’ve written the code in PHP. All you need to do is to upload this script to your website after changing the details to your own, and then you can have your very own RSS feeds of your Tweets. Unfortunately this won’t work for mentions, but perhaps I (or someone else) could create a script for that using authentication.

To use this, change the username to your own, set the url to the path of the file and upload it to your hosting space. This url will be your RSS feed which you can use for IFTTT.

<?php
// Update the following with your details:
$twitter_username = "iagdotme";
$this_url = "http://mywebsite.com/tools/json2rss.php";
header('Content-type: application/atom+xml');
?>
<rss xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:twitter="http://api.twitter.com" version="2.0">
<channel>
<title>Twitter</title>
<description>Twitter Updates</description>
<link>http://twitter.com/<?php echo $twitter_username;?></link>
<atom:link type="application/rss+xml" href="<?php echo $this_url;?>" rel="self"/>
<?php
$string = json_decode(file_get_contents("https://api.twitter.com/1/statuses/user_timeline.json?screen_name=$twitter_username"),$assoc = TRUE);
foreach($string as $items)
 {
 ?>
 <item>
 <title><?php echo $items['text'];?></title>
 <description><?php echo $items['text'];?></description>
 <pubDate><?php echo $items['created_at'];?></pubDate>
 <guid>http://twitter.com/<?php echo $twitter_username;?>/statuses/<?php echo $items['id'];?></guid>
 <link>http://twitter.com/<?php echo $twitter_username;?>/statuses/<?php echo $items['id'];?></link>
 </item>
 <?php
 }
?>
 </channel>
</rss>

I hope this is helpful to you, if you have any more thoughts- let me know in the comments below!

Like this Post? Like the Seriously Social Facebook Page!


Want in on the latest tools, tips, hacks & techniques?

Get the Seriously Social Newsletter for Free!

You will receive an email no more than once a week.


About Ian Anderson Gray

Ian is a speaker, coach, social media consultant, web developer & Partner of Select Performers. In real life he is a husband, dad and geek and is rather partial to tea, coffee & Indian cooking. Find out more



The Seriously Social Community

What do you think? Join the fun & Let me know below...

There are 65 comments

Your email address will not be published. Required fields are marked *