Beispiel #1
0
    def get_items(self, since):
        """Use of oauth token to fetch the users updates."""
        api = get_api(self.service)

        timeline = []

        # Get the api and bail if we fail
        if api:
            try:
                # Fetch 200 tweets, should be enough for a week...
                timeline = self._convert_feed(
                    api.user_timeline(
                        count=200,
                        include_rts='true'
                    ),
                    since,
                    api.me().screen_name
                )
            except TweepError, exception:
                raise LoggedServiceError(original_exception=exception)
Beispiel #2
0
def get_items(user, since, model_instance=None):
    """Use of oauth token to fetch the users updates."""

    serv = model_instance or get_model_instance(user, __name__)
    api = get_api(serv)

    timeline = []
    
    # get the api and bail if we fail
    if not api:
        return timeline
    
    try:
        # fetch 200 tweets, should be enough for a week...
        timeline = _convert_feed(user, 
                                 serv, 
                                 api.user_timeline(count=200, 
                                                   include_rts='true'), 
                                 since, api.me().screen_name)

    except TweepError, exception:
        raise LoggedServiceError(original_exception=exception)