VickiLanger / LGBTQ-of-the-day-bot

Twitter bot tweeting fun goofy lgbtq things and queer history of the day
https://twitter.com/LGBTQotd
GNU General Public License v3.0
81 stars 172 forks source link

TOP PRIORITY: Alt text not working #105

Closed VickiLanger closed 3 years ago

VickiLanger commented 3 years ago

Describe the bug Tweet alt text just shows alt="Image". Here's an example tweet. It should read the same text as what is being put on the image.

Alt text was added via PR #100 from issue #98

Expected behavior Alt text should read the same text as what is being put on the image.

Screenshots Screen Shot showing image not having actual alt text

Additional context Alt-text is currently at https://github.com/VickiLanger/LGBTQ-of-the-day-bot/blob/production/tweet.py#L50 tweet_text is currently at https://github.com/VickiLanger/LGBTQ-of-the-day-bot/blob/production/get_tweet_content.py#L16


Don't forget to follow the bot on Twitter to see the hard work you put in.

JasirZaeem commented 3 years ago

Just noticed this as well, I am sending a pull request to hopefully fix this.

VickiLanger commented 3 years ago

Awesome, thanks! I really want to make sure the tweets are accessible to everyone. It's not quite the end of the world since the text is in the tweet, but still should be there.

I'm still looking at the font issue. (and to be honest, having a heck of a time focusing today.)

JasirZaeem commented 3 years ago

I would like there to be alt text as well I think it is very important. Couldn't test it myself since I do not have twitter api keys, I have created a pull request to hopefully fix alt text, and a small error in replies.

JasirZaeem commented 3 years ago

That did not seem to have fixed it, I'll research it a bit to see if I can find a fix, I think this should remain open in case someone else is able to fix this

VickiLanger commented 3 years ago

Here's an example of working alt text. api.create_media_metadata(media_id=gif_upload.media_id, alt_text="randomly generated gif, hopefully depicting a hug") reference

JasirZaeem commented 3 years ago

This was the first thing I tried but it did not work unfortunately, I then tried passing the id in string form which is what the current code does. I did not think it would make difference but maybe explicitly making it a named parameter like media_id=image.media_id would make it work, I'll make a pull request doing that.

VickiLanger commented 3 years ago

I'll check this out later.

current error:

An error occurred while generating image. reason: 'API' object has no attribute 'create_media_metadata'

But the tweep docs have this http://docs.tweepy.org/en/latest/api.html#API.create_media_metadata

JasirZaeem commented 3 years ago

I hadn't noticed the tweepy version in requirements.txt was not the latest one, create_media_metadata was added in the newest version which is likely why you get this error, I have created a PR to hopefully fix this #277

VickiLanger commented 3 years ago

Oh! You're right. That might be the problem. Good catch

JasirZaeem commented 3 years ago

image Alt text seems to be working now, I think this issue can be closed then

VickiLanger commented 3 years ago

I just saw that!!! Thanks again for figuring out what was wrong.

JasirZaeem commented 3 years ago

Just glad it's finally fixed after so long :D, finally got time to think about it after exams and other work