egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
371 stars 65 forks source link

fix(media): Add alt text support for accessibility #53

Closed klausi closed 5 years ago

klausi commented 5 years ago

See https://blog.twitter.com/developer/en_us/a/2016/alt-text-support-for-twitter-cards-and-the-rest-api.html

Not sure why the Twitter docs don't mention the ext_alt_text field at https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/entities-object#media , maybe they forgot to document it there?

I have not looked into test coverage yet.

klausi commented 5 years ago

Thanks a lot! Twitter has never updated the blog post about alt text, the API parameter include_ext_alt_text is still required. See https://twittercommunity.com/t/is-include-ext-alt-text-still-required/74651

Added a sample tweet file, added a parse test case. Slapped the include_ext_alt_text on all the places that I think it is needed. Tested tweet show and user timeline manually with that, alt text is included.