ckoepp / TwitterSearch

A Python library to easily iterate tweets found by the Twitter Search API
MIT License
387 stars 112 forks source link

My first time using GIT so if if I need to post this info in a different way let me know. #5

Closed whitecow closed 11 years ago

whitecow commented 11 years ago

The def next(self): was not working correctly it would return all of the items in the list except the last one.

So if I had tweeted the following

whitecowtest does this make sense

whitecowtest so this is love?

whitecowtest HELLO Mother

I would only get the following returned.

whitecowtest so this is love?

whitecowtest HELLO Mother

Below is the correct code for def next(self):

def next(self):
if self.nextTweet < len(self.response['content']['statuses']): strresponse = self.response['content']['statuses'][self.nextTweet] self.nextTweet += 1 return strresponse

    try:
        self.searchNextResults()
    except TwitterSearchException:
        raise StopIteration
    if len(self.response['content']['statuses']) != 0:
        self.nextTweet = 0
        return self.response['content']['statuses'][self.nextTweet]
    raise StopIteration
ckoepp commented 11 years ago

That's fine - don't worry about the type of posting issues. You could also fork the repository and patch it directly but since this is only a small change it's perfectly fine by sending an issue.

Thanks a lot for reporting this bug! I'll fix it within the next days.