↓ Skip to main content
  1. Home projects/

Following-of-following monitor

··

A small Python script for the Twitter API (v2, through tweepy). It answers one question: whom did the people I follow start or stop following?

  • It fetches the list of accounts followed by one account, then, for each of those, the accounts they follow.
  • Each list is saved as JSON in a folder named after the date.
  • Every run compares the newest snapshot with the previous one and writes a plain-text report: for each followed account, who was added and who was removed.
  • User IDs are turned into names through a local cache that is filled in from the API as needed.

The script respects the API rate limits. It refetches one user’s list only when the saved copy is older than three hours, and the root list once a day.

Related