May 20, 2013: Seriously Social News Podcast Special Edition- Google I/O

All the Social Media & Tech News you need to know!

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

twitter-ifttt

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 RSSare 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.

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!


Share this Article


Subscribe

Enjoy this Post? Subscribe to the Seriously Social Newsletter!


Listen to the latest Seriously Social News Podcast!

May 20, 2013: Seriously Social News Podcast Special Edition- Google I/O

All the Social Media & Tech News you need to know!


Comments


Show/Hide Triberr Comments »

  • James

    Thanks really helpful advice. I only just found out about IFTTT and disappointed now it’s gone.

    • http://iag.me/ Ian Anderson Gray

      No problem. I’m a massive Twitter fan and user, but I just don’t understand why they are doing this and even more so why they think RSS is dead and JSON the way forwards.

  • http://alphaefficiency.com Bojan Djordjevic

    I am archiving this in my reference material.

    • http://iag.me/ Ian Anderson Gray

      Cool. Let me know how you get on and if you have any thoughts on this.

      • http://alphaefficiency.com Bojan Djordjevic

        It’s gonna take me a while, have whole bunch of things to do prior to this…

        • http://iag.me/ Ian Anderson Gray

          I know the feeling!

  • http://b2bdigital.net/ Eric Wittlake

    Ian, would you get something “close” to a mention feed if you searched for your own username and then in the output filtered out anything from you?

    This would include Twitter’s new retweets of your own Tweets as well as other new RTs that include your handle, returning a bit more than the new “mention” search, but depending on your purpose that could be a good thing.

    • http://iag.me/ Ian Anderson Gray

      Twitter’s search API isn’t that great in my experience. Also I think you might have to end up using some form of authentication. Twitter’s use of JSON is all about having more control and I expect creating an app to do the above would be against their terms. I am continuing to look at this and will post back if I find a way!

  • http://ClinicalPosters.com/ ClinicalPosters

    Thanks for sharing. This is becoming quite convoluted.

    • http://iag.me/ Ian Anderson Gray

      I couldn’t agree more.

  • http://www.wonderoftech.com Carolyn Nicander Mohr

    Thanks for this. I miss this functionality terribly. I was Buffering tweets using IFTTT thanking people for following me. I hope Twitter changes their policy soon.

    • http://iag.me/ Ian Anderson Gray

      Hi Carolyn, thanks for your comment. I miss the IFTTT triggers a lot too. It is absolute madness on Twitter’s part. Unfortunately I think there is very little chance of them changing their mind. That is unless many of us band together and voice our opinion– but there would have to be a lot of us making a lot of noise!

  • http://www.dzama.ca/ Dzama

    Thank you! I’ve been looking for a great workaround since the IFTTT twitter triggers went down. This works perfectly.

    • http://iag.me/ Ian Anderson Gray

      Brilliant. Which method are you using? Are you using the RSS feeds or have you tried the JSON to RSS script? Please let me know!

      • http://www.dzama.ca/ Dzama

        I’m using the JSON to RSS script with a little modification. I wanted the script to act like (if not better than) the old IFTTT trigger (in that it could be triggered with a specific hashtag which is then removed). Also wanted to clean away the “#” in front of each hashtag (Good if your posting to another social networks). If interested in doing the same, add an if statement to the foreach loop:

        $hashtag = '#TriggerHashtagGoesHere';
        foreach($string as $items)
        { if (strpos($items['text'], $hashtag) !== false){

        and this to the title and description tags:

        echo str_replace('#', '', str_replace($hashtag, '', $items['text']));

        Thanks again, you saved me a lot of headache.

        • http://iag.me/ Ian Anderson Gray

          Fab, that’s really helpful. I’d love to be able to replace the Twitter mentions trigger too, but that’s for another time…!

  • http://twitter.com/Soulati Jayme Soulati

    Just saw a post last week about IFTTT and was all excited to jump on board. Alas, not so much.

    • http://iag.me/ Ian Anderson Gray

      Thanks for your comment. I’m interested in your thoughts as to why you’re not interested in IFTTT. I have to say even without the Twitter triggers, it’s one of the most useful web and social media tools out there. Hopefully this post will make it helpful for you.

      • Fianor

        Without twitter triggers IFTTT is absolutely useless to me. I have gone through every trigger and action trying to find any other use for me and there is none.

  • Pingback: Feeding from Twitter into Evernote again | finding the {inner} geek