Display tweets from multiple users (similar to the built-in timelines) without user user lists

I am new to Twitter and need some advice.

I need to display a tweet feed from multiple users on a webpage.

The first thing I stumbled upon was the Built - in Time Frame . It allows you to display tweets from the list of users, but gotcha is that these lists should be supported on the Twitter side (i.e. I can not specify @qwe and @asd only on my side and get a timeline without adding these users to the list on the side of Twitter).

The fact is that the list of users that should be included in the chronology is dynamic, and managing these lists via the Twitter API is likely to be painful. Not to mention that my website is likely to generate tons of these listings, and I feel that sooner or later I will violate some api quotas.

So my question is: am I stuck with using built-in time series that reference a user list on the Twitter side and manage these lists via, say, a Twitter REST api, or is there an easier way to do what I want?

+4
source share
1 answer

It is very easy to display tweets for multiple users.

Links to start with

  • This post explains some of the searches you can do.
  • This post is a simple library for querying the twitter API, which just works.

Your request

Good, so you need several users. The endpoint you are using is search/tweets one: https://api.twitter.com/1.1/search/tweets.json .

The query string uses :from , and you can interpolate several from with AND / OR .

Example request for a GET request:

 ?q=from:user1+OR+from:user2 

Learn more about search API requests here .

Oversupply Problem

This is what you will need to figure out on your own - depending on the number of requests you expect to make and twitter restrictions imposed , maybe something like caching or saving information when you click your limit, and only back out of the cache until you push your limit.

+7
source

Source: https://habr.com/ru/post/1490302/


All Articles