The Twitter module integrates Twitter with your site to allow you to display tweets from your twitter account as well as post a tweet automatically when you create content on your Drupal site. It can also be used to authenticate accounts through Twitter like we did with HybridAuth, but is limited to only Twitter, and since we've already set up HybridAuth to support multiple service providers, we won't be covering that in this series.

In this video, I will show you how to install and enable Twitter module and configure some of the basic settings.

Install Modules

Enable Modules

  • Go to "Modules" (admin/modules) and enable:
    • Chaos tools
    • OAuth (Twitter uses OAuth to provide authorized access to its API.)
    • OAuth Provider UI
    • Twitter
    • Twitter actions
    • Twitter Post
    • Views
    • Views UI
  • (Save configuration)

Now that we have installed and enabled the Twitter module, we need to go to the Twitter module settings page.

  • Go to "Configuration => Web services => Twitter => Settings" (admin/config/services/twitter/settings)

On this page, we can configure the Twitter options.

  • [x] Import and display the Twitter statuses of site users who have entered their Twitter account information. (Gives the ability to import and display Tweets on your site. This will only display tweets from accounts that are specifically added in the "Twitter" tab, which we'll get to in the next video.)
  • Delete old statuses: Choose "1 month" (This will delete status that over a month old. Setting this to anything other than "Never" will prevent your database from getting infinitely large. I strongly encourage you to select one of the other options.)

OAuth Settings

  • Callback URL (The return path after a successful authentication)

Now for the OAuth Consumer key and OAuth Consumer secret keys we'll need to create a Twitter application like we did in video 4. So, in the next video, I will show you how to create that Twitter application, and we'll finish setting up the site to post tweets to, and receive tweets from our Twitter account.