0

I have a website with 3 sub pages. These 3 sub pages are information pages about 3 persons. What is the easiest way to give every page a dynamic twitter feed, linked to that person?

All I can find on the web are static feeds, just for 1 person.

Thanks in advance

  • Twitter recently announced [New feature: Dynamic timeline selection for embedded timelines](https://dev.twitter.com/discussions/18411). This may help you. – Ben Ripley Jul 15 '13 at 13:25
  • Jayce - If my answer helped, could you 'tick' it as correct on the left please? Else I'll delete... thanks. – Jimbo Jul 25 '13 at 11:23

1 Answers1

0

Firstly, the only thing you can / should do with client-side code for the new v1.1 API is: show a timeline using a widget.

Using this widget, if you choose the "search" option, you can construct a search query using your requirements to achieve the desired result.

Head to the create a search widget page, and here enter the following query:

from:user1+OR+from:user2

This'll give you a feed for multiple people.

However, if you want to do this dynamically, you can't use a widget and you will need to be using a server-side language (like PHP) to get the data you require.

If you choose PHP, here's a post a lot of people have found useful, step-by-step with pictures, on how to make authenticated requests to the twitter 1.1 API.

You'll want to be using the endpoint: tweets/search with the previously mentioned query as ?q=from:user1+OR+from:user2.

This way, you can inject the username into the query dynamically within your PHP code before shooting off the request - how you perform this architecturally is entirely up to you, but the above post and library are a great start.

Community
  • 1
  • 1
Jimbo
  • 25,790
  • 15
  • 86
  • 131