get_oembed_tweet() uses incorrect endpoint #497

Closed
opened 2018-09-03 03:17:37 -07:00 by RedactedCode · 0 comments
RedactedCode commented 2018-09-03 03:17:37 -07:00 (Migrated from github.com)

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
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.](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed) 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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#497
No description provided.