Reputation: 4141
I am trying to get tweets by multiple public account say @TwitterDev
and @tolga_tezel
.
Using node.js and twit
package for this purpose.
T = new Twit({
consumer_key: TWITTER_CONSUMER_KEY,
consumer_secret: TWITTER_CONSUMER_SECRET,
access_token: TWITTER_ACCESS_TOKEN,
access_token_secret: TWITTER_ACCESS_TOKEN_SECRET,
});
getTweets = async (request:Request, reponse:Response)=>{
//const {keyword} = request.params;
const data = await this.T.get('statuses/user_timeline', { screen_name:'twitterdev', count: 10 });
reponse.send(data);
}
Something like :
const data = await this.T.get('statuses/user_timeline', { screen_name:'twitterdev', screen_name:'tolga_tezel', count: 10 });
How can it be done? Can it be done in a single api call?
Upvotes: 0
Views: 180
Reputation:
It is not possible to do this in a single API call. The statuses/user_timeline
API only takes a single username (screen_name) as a parameter (see the Twitter documentation). To achieve this you will need to make multiple calls to the user_timeline API, with an individual username each time.
Upvotes: 2