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

get_oembed_tweet() uses incorrect endpoint #497

Closed
RedactedCode opened this issue Sep 3, 2018 · 0 comments
Closed

get_oembed_tweet() uses incorrect endpoint #497

RedactedCode opened this issue Sep 3, 2018 · 0 comments

Comments

@RedactedCode
Copy link

attempting to use this function gives
TypeError: get_oembed_tweet() takes 1 positional argument but 2 were given

example code to reproduce:

import urllib
x = twitter.get_user_timeline(screen_name='realdonaldtrump', count=1)
y = 'https://twitter.com/'+x[0]['user']['screen_name']+'/status/'+x[0]['id_str']
y = urllib.parse.quote_plus(y)
z = twitter.get_oembed_tweet(y)

Twitter API doc for this method here.

Twython assumes the wrong endpoint.

Correct endpoint is https://publish.twitter.com/oembed

and a properly constructed call for my example above should look like

https://publish.twitter.com/oembed?url=https%3A%2F%2Ftwitter.com%2FrealDonaldTrump%2Fstatus%2F1036254993052053505
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

1 participant