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

Timeline CLI command should not assume that the user exists #626

Closed
timothyjgraham opened this issue Apr 20, 2022 · 2 comments · Fixed by #628
Closed

Timeline CLI command should not assume that the user exists #626

timothyjgraham opened this issue Apr 20, 2022 · 2 comments · Fixed by #628

Comments

@timothyjgraham
Copy link

timothyjgraham commented Apr 20, 2022

For no obvious reason when I try to collect timeline data, I receive the error below. Here is the command:

twarc2 timeline --use-search seanmantess seanmantess_timeline.jsonl

Here is the error:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/twarc2", line 8, in <module>
    sys.exit(twarc2())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/twarc/decorators2.py", line 180, in __call__
    return self.f(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/twarc/command2.py", line 1327, in timeline
    user["created_at"], "%Y-%m-%dT%H:%M:%S.%fZ"
KeyError: 'created_at'

I have upgraded twarc and reinstalled Python3, as well as reauthenticating my Twitter credentials with twarc. I am using the --use-search parameter because I have academic API access. I also tried without this parameter and still gives an error.

I am running macOS 10.14.6.

@SamHames
Copy link
Contributor

Ah, this is a bug in twarc, but the cause is the username doesn't exist anymore (either changed or been deleted). If you have the user ID from somewhere else you might want to confirm with that.

@SamHames SamHames changed the title Getting error when collecting timeline Timeline CLI command should not assume that the user exists Apr 20, 2022
@timothyjgraham
Copy link
Author

timothyjgraham commented Apr 20, 2022 via email

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

Successfully merging a pull request may close this issue.

2 participants