I'm trying to embed tweets based on users' search terms.
I can retrieve tweets from Twitter's search API, but then none of the URLs I get back in twitter's response are compatible with the oEmbed API, so I can't display the tweets I'm getting.
I send a GET
to https://api.twitter.com/1.1/search/tweets.json?q=${VARIABLE}
, and here are all of the URLs I get back:
display_url: "twitter.com/i/web/status/1…"
expanded_url: "https://twitter.com/i/web/status/1328842765115920384"
url: [shortened URL that Stack Overflow will not let me print]
However, for the oEmbed API, the url needs to be in the format of https://twitter.com/[username]/status/[id]
.
Can anyone help as to how I can utilise the search api and then display those tweets on screen?