FixTweet / FxTwitter

Fix broken Twitter/X embeds! Use multiple images, videos, polls, translations and more on Discord, Telegram and others
https://fxtwitter.com
MIT License
2.62k stars 77 forks source link

`<meta name=...>` and `<meta property=...>` used inconsistently #84

Closed sfan5 closed 2 years ago

sfan5 commented 2 years ago

I stumbled upon this because I have a regex that parses HTML (yes I know), probably low-priority since other people use real parsers. Example:

<meta name="og:image" content="https://pbs.twimg.com/media/FUBKu4QXoAAqMIL.jpg"/>
[...] <meta content="jack (@jack)" property="og:title"/>

Mozilla documentation suggests only name is valid while the Opengraph spec consistently uses property. I'd suggest consistently using the latter.

dangeredwolf commented 2 years ago

Yeah I've been meaning to make those consistent but I just didn't get around to it as yeah it didn't really affect very many people. So I will fix that.

I will note that if you're trying to only parse FixTweet responses and are not just making a general purpose embed tool I would suggest looking at FixTweet's status Fetch API which returns the same data we use to make embeds but in an easily parseable JSON form. Basically you can get it by using api.fxtwitter.con instead of fxtwitter.com on links.

https://github.com/dangeredwolf/FixTweet/wiki/Status-Fetch-API