Coder132
Coder132

Reputation: 11

How twitter shows tweets from the people we follow

I'm writing an api in nodejs and I'm trying to figure out how twitter and facebook shows posts from only the people that we follow.. My initial thought was loop through the posts and filter them according to followers ID, but that consumes a lot of CPU because we've to the loop through all the posts in the MySQL DB. What is the correct logic to show only the tweets/posts from the subscribed people/friends

I would be grateful if someone could through some light.

Upvotes: 0

Views: 61

Answers (1)

Jonas
Jonas

Reputation: 4048

Isn't this what you want?

https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline.html

Just remove your posts from the result set.

Upvotes: 1

Related Questions