Using Twitter oAuth with Drupal

September 6, 2010, 17:50 pm

Steps to Get Twitter.module working with Rules:

Required Modules:

Take the following steps:

  1. Install a few modules: To start with, install the following modules:

    • oAuth
    • Twitter
    • Twitter Post
    • For using Rules (optional)
      • Twitter actions
      • Token
      • Rules
      • Rules Administration UI
  2. OAuth settings: Visit the oAuth setting page (admin/settings/oauth) and under OAuth cryptography select “RSA-SHA1” and click “Save configuration”.

  3. Register with Twitter: On the Twitter settings page (admin/settings/twitter) you now need to register your application with Twitter (https://twitter.com/apps/new).

    • Application Name: a simple name to identify what you are doing.
    • Description: Minimum of 10 characters is required.
    • Application website: The URL of the website your are registering.
    • Organization: Your organization name.
    • Website: Your homepage URL.
    • Application Type: Browser
    • Callback URL: This is provided by the Twitter module (admin/settings/twitter) http://{your_url}/twitter/oauth
    • Default Access type: Read & Write
  4. Secrets: Once the application has been registered, Twitter will provide you with the Consumer key and Consumer secret. Enter those on the Twitter module settings page back on your site (admin/settings/twitter) and click “Save configuration”.

  5. Post to Twitter (Optional): If you wanting an option to post to Twitter when you add new content to your site, click the “Post” tab and select the node types you want it to show on as well as set the default format of the post.

  6. Setup your account: This next step is critical. Edit your account page and select the sub-tab of “Twitter accounts” (user//edit/twitter) and click “Add account”. This will take you to the Twitter.com page to authorize and allow access to your account.

    • If you want to use the “Post to Twitter” form at the bottom of the new node’s you can make this account global to the site by clicking “make global”. This will not effect the rules module.
  7. Time to add a rule (Optional: Rules integration): Go to the “Add a new rule” page (admin/rules/trigger/add), set the name, and set the Event for “After saving new content”. On the next page, add and action of “Post a message to Twitter”. On the setting page, enter the Twitter account name that you authorized in step 6. Enter the message that you want to tweet. If you installed the Token module you will be able to add tokens like “Node Title”.

  8. Watch it work! Now all you need to do is create a new node and it will post a message to the Twitter account you specified.

This totally worked!

This totally worked! Woo-hoo!

Thanks, mucho.

-arvan

Strange but none of this

Strange but none of this appears

Step 2 does not give me such an option.

Step 4: No place to enter secrets

Twitter 6.x-3.x
Oauth 6.x-3.0

Thanks for the concise

Thanks for the concise instructions! Worked like a charm first time.

you need OAuth 6-2.0, OAuth

you need OAuth 6-2.0, OAuth 6-3.0 won't work

Thanks its working

Thanks its working fine.
thanks.

This worked for me. I've been

This worked for me. I've been trying to integrate my social media with Drupal and my email marketing solutions for the longest time.

Thanks so much!

I tried this time and time

I tried this time and time again and I cannot seem to get this to work. I downloaded all the correct files, applied the patch via terminal (on my mac), and closely followed all the steps. Is there an updated patch I now need to use? I am missing something big here.

Any help would be great!

Thanks.

Great Blog, thank you for the

Great Blog, thank you for the post. Having problems though, did the entire walkthrough but does anyone else get this message in user account? Can anyone advise? Thank you.

Fatal error: Cannot use object of type TwitterUser as array in twitter.module on line 58

how to install the

how to install the patch/diff?

You can apply the patch using

You can apply the patch using the method recommended for Drupal: http://drupal.org/patch/apply

This was massively helpful.

This was massively helpful. All working fine for me and outputting from views nicely as a block.

The one thing I'm stuck on is having the whole twitter item link back to the twitter page (like in your 'Friendfeed' list). At the moment, I'm just getting the text.

I'm sure I'm missing something obvious here...

Once the application has been

Once the application has been registered, Twitter will provide you with the Consumer key and Consumer secret. Enter those on the Twitter module settings page back on your site (admin/settings/twitter) and click “Save configuration”.

Good day, I installed

Good day, I installed oauth-6.x-2.02 and twitter-6.x-3.0-beta3, but when I create the Twitter accounts for user redirects to the page tweeter and gives me a pin, where I put that pin? I fail to work.

This worked for me. I've been

This worked for me. I've been trying to integrate my social media with Drupal

Very good step by step

Very good step by step instruction, i'm implementing it right now!

Once the application has been

Once the application has been registered, Twitter will provide the consumer key and consumer secret. Back to your site (management / set / Twitter) Enter the Twitter module settings "page, click on" Save Configuration.

Post new comment

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

More information about formatting options

Flickr recent photos

rss
The BEST Indian Restaurant in North America... Dangerous AND unlawful!Good morning Jesus!Iced overGlass WorkPure Maple

User login