new Twitter oEmbed endpoint (shortcode input changes from tweet ID to full URL)

https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed

some hacking is required to continue passing only the tweet ID to <amp-twitter data-tweetid="..."> at the same time. ugh.

https://amp.dev/documentation/components/amp-twitter/#attributes
This commit is contained in:
2020-06-28 11:29:35 -04:00
parent 3bfa8a52cc
commit 99d13da0c7
7 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
{{- $url := printf "https://api.twitter.com/1/statuses/oembed.json?id=%v&dnt=1&omit_script=1&align=center" (index .Params 0) -}}
{{- $url := printf "https://publish.twitter.com/oembed?lang=en&omit_script=true&dnt=true&align=center&url=%s" (index .Params 0 | safeURL) -}}
{{- $json := getJSON $url -}}
<div class="embed tweet">