skip to Main Content

I want user’s tweet data whenever they tweet new. But without running script every 15 minutes to know whether they have new tweet or new. It takes lots of resources. Is there any way that I will get data only when they tweet?

2

Answers


  1. Twitter has a webhook API that you can hook into.

    https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/subscribe-account-activity/guides/getting-started-with-webhooks

    Essentially,

    1. Register your application on Twitter Developer platform.

    2. Create an API endpoint on your Django application that will accept this request when Twitter sends it to you.

    3. Submit that API endpoint in your deployed app to the Twitter application that you created in step 1.

    4. Do what you want with the request.

    That being said, Twitter’s API has been locked down considerably so applying for a developer account may take a while.

    Login or Signup to reply.
  2. I’d recommend taking a look at the filtered stream API. Assuming the account is not protected, you can use the from: operator to receive Tweets in real-time whenever the user Tweets something new.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search