How to add multiple Twitter feeds to any template site


While the social media menu adds links to your social media profiles, you can also add multiple Twitter feeds to any template site.

An example of pulling your Twitter feed into your template site is on the UMatter.princeton.edu website.


Get the necessary Twitter tokens

Go to: https://apps.twitter.com and log into your Twitter account.

Click Create New App button.

Complete the necessary fields in the form.

  • Name: Enter name of the site where you pulling the twitter feed into
  • Description: The [sites name] that will pull in the Twitter feed
  • Website: site URL
  • Callback URL site URL
  • Check the Developer Agreement box.

Click Create your Twitter application

Click on the Keys and Access Tokens tab

Copy and paste the Consumer Key (API Key) and Consumer Secret (API Secret) into a word doc or any other holding place so that you can paste them later into the Drupal administration settings.


Authenticate the Twitter account to the Drupal website

Log into your Drupal website.

From the Admin main menu, navigate to the Twitter application settings: Configuration --> Web services -> Twitter

twitter configuration path

There are two tabs, Twitter and Settings. First select the Settings tab.

Twitter settings tab

Paste the Consumer Key and Consumer Secret code into their respective fields.

Click Save Configuration at the bottom of the page.

Click on the Twitter tab

Twitter tab

Click the Go to Twitter to add an authentication account button.

Go to twitter button

A Twitter page will open – Enter your Twitter credentials and click the Authorize app button. If you are still logged in from getting the Auth codes, you will not need to log in, you will just need to click the button.

authorize twitter app

You will be returned to the Twitter admin page. Click the Tweets checkbox and View will appear under the box. Your Twitter feed cannot be set to Private in order for Drupal to display the feed.

twitter settings checkboxes

Click the Save Changes button.

save changes

Tweets are imported into your site hourly.

Verify that they have been imported by visiting a listing of all your tweets at their default landing page:

yourwebsite.princeton.edu/tweets

You can add as many Twitter feeds as you want using the Twitter settings tab, including non-authenticated accounts. All tweets from all accounts will appear in the same listing/view. At this time it is not possible to put separate tweet feeds into separate listing/displays.


Add the Twitter feed to a panel on any web page

Click the Customize this page at the bottom of your browser window.

Customize button image

Click the Plus+ sign to add a node.

Plus icon image

Select Twitter to add content.

add Twitter content

Click one of the two green Add buttons. There are currently two buttons; formatted and unformatted. The formatted feed can be restricted to a certain number of tweets and can also skip a certain number of tweets. The unformatted feed has functionality issues of which WDS is aware. Contact WDS if you wish to have your twitter feed styled for your site using CSS.

Add twitter feed


Troubleshooting

  • Your Twitter feed must be set to public, not private.
  • You may find that deleting and re-adding your Twitter account can fix any troubles in displaying your feed.
  • New items may not appear on your website for up to 9 hours due to our caching configuration for performance.