Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

fixed pagination bug not extracting tweets after first page #150

Merged
merged 3 commits into from
Jul 16, 2020

Conversation

xeliot
Copy link
Contributor

@xeliot xeliot commented Jun 27, 2020

Fixes issue (#101)

Brief summary of how I fixed it by modifying tweets.py:

Change r = session.get(url, headers=headers) to r = session.get(url+'&max_position', headers=headers). This allows response json to return min_position parameter which will then be used as the max_position parameter in the next session.get

r_json = r.json()

Change r = session.get(url, params={'max_position': last_tweet}, headers=headers) to r = session.get(url, params={'max_position': r_json['min_position']}, headers=headers).

This gets rid of twitter pages repeating on search query.

@bisguzar
Copy link
Owner

bisguzar commented Jun 30, 2020

Thanks for your contribution @xeliot . We have an issue which pointing this problem (#101 ). But its appearing if you try getting tweets from hashtaghs. Is it same thing? Could you explain your problem? Its better if you fill the description :/

PS: I saw your comment on issue now. Just bad space to write description, lol. I saw your PR before your comment which one writed on the issue. my bad...

Copy link

@seaona seaona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it works correctly!

@iamMehedi
Copy link

Any updates on merging this?

@bisguzar
Copy link
Owner

Thanks for update @iamMehedi . Just merging this awesome contribution :). I'll push to PyPI as soon as possible.

@bisguzar bisguzar merged commit 8bab41b into bisguzar:master Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants