Example #1
0
 def _update_cache(self):
     logger = log.getLogger('twactor.PublicTimeline.update')
     logger.debug('Updating public timeline')
     try:
         return self._connection_broker.get('/statuses/public_timeline.json')
     except Exception, exc:
         # TODO: implement better error handling.
         logger.error('Error fetching public timeline update')
Example #2
0
 def _update_cache(self):
     logger = log.getLogger('twactor.Tweet.update')
     logger.debug('Updating cache for tweet %d' % (self.id,))
     try:
         data = self._connection_broker.get(
             '/statuses/show/%d.json' % (self.id,))
     except Exception, exc:
         # TODO: implement better error handling.
         logger.error('Error fetching info for tweet ID %d' % (self.id,))
Example #3
0
 def _update_cache(self):
     logger = log.getLogger('twactor.User.update')
     logger.debug('Updating cache for user %s' % (self._identifier,))
     try:
         data = self._connection_broker.get('/users/show/%s.json' % (
             self._identifier,))
     except Exception, exc:
         # TODO: implement better error handling.
         logger.error('Error fetching user info for %s' % (
             self._identifier,))
Example #4
0
 def _update_cache(self):
     logger = log.getLogger('twactor.UserHistory.update')
     logger.debug('Updating data for user %s' % (self.user.username,))
     path = '/statuses/user_timeline/%s.json' % (self.user.username,)
     params = {'page': self._cache_page, 'count': self._count}
     try:
         data = self._connection_broker.get(path, params=params)
     except Exception, exc:
         # TODO: implement better error handling.
         logger.error('Error fetching data')
Example #5
0
 def _update_cache(self):
     logger = log.getLogger('twactor.UserTimeline.update')
     if ((time.time() - self._updated.get('__time', 0)) <
         self.UPDATE_INTERVAL):
         return []
     logger.debug('Updating data for user %s' % (self.user.username,))
     params = {'count': self._count}
     if self._cache:
         params['since_id'] = self._cache[-1]['id']
     path = '/statuses/user_timeline/%s.json' % (self.user.username,)
     try:
         data = self._connection_broker.get(path, params=params)
     except Exception, exc:
         # TODO: implement better error handling.
         logger.error('Error fetching user timeline update')