Since a few months ago the Twitter Developers Blog has been announcing an API cleanup which states that the REST API 1.0 will stop working in the coming days.

This is the list of modules that currently use the old REST API 1.0:

What I suggest is that these modules depend on Twitter module and change their API requests for the following:

    // Connect to Twitter.com and retrieve favorite tweets.
    module_load_include('inc', 'twitter');
    $twitter = twitter_connect();
    if ($twitter) {
      try {
        // The following retrieves favorite tweets for a user account. See the Twitter class at
        // http://drupalcode.org/project/twitter.git/blob/refs/heads/7.x-6.x:/twitter.lib.php for a full list of available methods.
        $statuses = $twitter->favorites_list($screen_name);
      } catch (Exception $e) {
        // Network errors can throw a Twitter exception, which we catch silently.
      }
    }

Thoughts?

Comments

dhavyd’s picture

It sounds like a nice quick fix. I'll try it...

opi’s picture

Hi. I'm the maintainer of the twitter_username module.
Thanks for the tips about the Twitter API Change. I made a new release of my module which no longer use Twitter API.

dhavyd’s picture

I could not make your code work on Twitter DB. But I have anyway changed the way the module retrieves tweets, so it works with new Twitter API 1.1 now, without any dependencies...

juampynr’s picture

@dhavyd, how does a user obtain the Consumer key and Consumer secret that he needs to enter at the Twitter DB settings form? I saw these at http://drupalcode.org/project/twitter_db.git/commitdiff/a13f86f.

dhavyd’s picture

You can get them in your Twitter App page...
twitter_db

jec006’s picture

Hi,

Thank you for this, I've committed your patch into a 2.x branch on Twitter Pull. I think this is a good way forward. It makes no sense for all of us to try to OAuth with Twitter through our own mechanisms.

juampynr’s picture

Glad to know is helping. Any suggestion to make Twitter Oauth support easier for contrib modules is more than welcome.