itteco / iframely

oEmbed proxy. Supports over 1800 domains via custom parsers, oEmbed, Twitter Cards and Open Graph
https://iframely.com
Other
1.51k stars 293 forks source link

Twitter embed not showing a card, images, or videos, only some text. #239

Closed dessalines closed 4 years ago

dessalines commented 4 years ago

The default twitter embed html only has some text, it doesn't have the proper card or anything, which should be its default behavior: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/get-statuses-oembed

Edit example

Actual card: https://twitter.com/AbbyMartin/status/1229139857408049152?ref_src=twsrc%5Etfw

iparamonau commented 4 years ago

Could you please copy-paste the JSON response from Iframely for that URL, and based on that response - let us know what you think is missing in it?

dessalines commented 4 years ago

Here's the JSON response:

{
  "type": "rich",
  "version": "1.0",
  "title": "Abby Martin on Twitter",
  "url": "https://twitter.com/AbbyMartin/status/1229139857408049152",
  "author": "Abby Martin",
  "author_url": "https://twitter.com/AbbyMartin",
  "provider_name": "Twitter",
  "description": "Holy shit. Amy Klobuchar has no idea who the Mexican president is, nor anything about his party or policies, yet wants to win the votes of millions of latinos in bordering states. This should be disqualifying for a Senator, let alone a presidential candidate. pic.twitter.com/W2ECYydCbw— Abby Martin (@AbbyMartin) February 16, 2020\n\n",
  "thumbnail_url": "https://pbs.twimg.com/ext_tw_video_thumb/1229138259684413440/pu/img/aSSTTf_BNbyqsloL.jpg",
  "thumbnail_width": 1200,
  "thumbnail_height": 675,
  "html": "<blockquote class=\"twitter-tweet\" data-lang=\"en_US\"><p lang=\"en\" dir=\"ltr\">Holy shit. Amy Klobuchar has no idea who the Mexican president is, nor anything about his party or policies, yet wants to win the votes of millions of latinos in bordering states. This should be disqualifying for a Senator, let alone a presidential candidate. <a href=\"https://t.co/W2ECYydCbw\">pic.twitter.com/W2ECYydCbw</a></p>&mdash; Abby Martin (@AbbyMartin) <a href=\"https://twitter.com/AbbyMartin/status/1229139857408049152?ref_src=twsrc%5Etfw\">February 16, 2020</a></blockquote>\n<script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n"
}

Here's how the oembed looks in discord for example. The iframely html code is missing things like :

iparamonau commented 4 years ago

User thumbnail Retweets / likes count A video embed.

Twitter doesn't make this information publicly available. To get the info, you need to connect to their data API directly. We used to have it, but removed 5 years ago by request from Twitter legal. They need any user of their API data to accept their terms - something we couldn't easily organize in the cloud.

You can still add a custom Iframely plugin and do it on your own, under your own account/api key with them.

dessalines commented 4 years ago

Okay, just making sure, thanks!