Updated to catch the oh so often 503 errors with Twitter's API
2 files changed, 11 insertions(+), 5 deletions(-) M twittersync/__init__.py M twittersync/helpers.py
M twittersync/__init__.py +1 -1
M twittersync/helpers.py +10 -4
@@ 50,7 50,13 @@ class TwitterSyncHelper(object): except TwitterStatus.DoesNotExist: latest = None - res = self.send_request(latest) - results = json.load(res) - for result in results: - self.save_status_update(result) + try: + res = self.send_request(latest) + except urlib2.HTTPError: + # Twitter often gives 503 errors when the + # API is overwhelmed. + pass + else: + results = json.load(res) + for result in results: + self.save_status_update(result)