Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use "next_token"? #676

Closed
myrainbowandsky opened this issue Dec 18, 2022 · 3 comments
Closed

Is it possible to use "next_token"? #676

myrainbowandsky opened this issue Dec 18, 2022 · 3 comments

Comments

@myrainbowandsky
Copy link

I tried but does not work. Does that mean I should restart the whole search?

@SamHames
Copy link
Contributor

If you're using the command line interface, yes, you'll need to restart the search. If you're seeing repeated API errors in the twarc.log file (such as 503 errors), it might be more stable for you to turn off context annotations (--no-context-annotations) and turn down the maximum results per page (--max-results (try 50/100)).

We have thought about resuming in the past (see #589), but it's quite a bit of work to do well and I don't think there's a lot of motivation around here to do that work given the state of Twitter as a platform right now.

@igorbrigadir
Copy link
Contributor

Just for reference, you can add a next_token yourself, if you're using Twarc as a library, https://twarc-project.readthedocs.io/en/latest/api/library/ the only thing missing is the command line commands and appropriate appending to existing files etc. So you'll have to read your own next_token from someplace, and make sure you're writing the output yourself: https://twarc-project.readthedocs.io/en/latest/api/client2/#twarc.client2.Twarc2.search_all

@myrainbowandsky
Copy link
Author

Thank you @igorbrigadir @SamHames . For command line, I think i can check the create_at and set the time window, which could be an alternative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants