What is the right approach for a Twitter app for Google App Engine?

I am trying to develop a Twitter application in the Google App Engine. The application basically collects all tweets from a Twitter user and his followers and their followers and so on. It usually collects 500 tweets per run per user and then inserts user data into the database.

The tweet collection process should be done every hour. I am currently using cron jobs for this. But it gives a lot of Deadline in excess of errors, even for a single user, which is not a good sign. I am using Python. So I wanted to know what should I use for this? I searched the Internet and found out that task queues with cron can be used. But I do not know how to do this. I will be very grateful if someone can help me. Also is there any other method / approach that I can use?

+3
source share
1 answer

DeadlineExceededExceptions, Push Task Queues. , - 10- , .

API , . , API , . , .

- Push Task Queues, , , . , :

import logging

from google.appengine.ext import deferred

  def do_something_expensive(a, b, c=None):
      logging.info("Fetching Twitter feeds!")
      # Fetch the Twitter data here


# Somewhere else - Pass in parameters needed by the Twitter API
deferred.defer(do_something_expensive, "BobsTwitterParam1", "BobsTwitterParam2", c=True)
deferred.defer(do_something_expensive, "BobsFriendTwitterParam1", "BobsFriendTwitterParam2", c=True)

Twitter , .., , , .

HTTP 200-299 10 . , 60- . , App Engine DeadlineExceededError ( google.appengine.runtime), , . , App Engine , .

, Twitter , , Twitter . , , , , .

, .

, - 10- , Backends.

+3

All Articles