vickilanger / lgbtq-of-the-day-bot Goto Github PK
View Code? Open in Web Editor NEWTwitter bot tweeting fun goofy lgbtq things and queer history of the day
Home Page: https://twitter.com/LGBTQotd
License: GNU General Public License v3.0
Twitter bot tweeting fun goofy lgbtq things and queer history of the day
Home Page: https://twitter.com/LGBTQotd
License: GNU General Public License v3.0
Dear developers,
Your project LGBTQ-of-the-day-bot requires "tweepy==3.9.0" in its dependency. After analyzing the source code, we found that the following versions of tweepy can also be suitable without affecting your project, i.e., tweepy 3.10.0. Therefore, we suggest to loosen the dependency on tweepy from "tweepy==3.9.0" to "tweepy>=3.9.0,<=3.10.0" to avoid any possible conflict for importing more packages or for downstream projects that may use ddos_script.
May I pull a request to further loosen the dependency on tweepy?
By the way, could you please tell us whether such dependency analysis may be potentially helpful for maintaining dependencies easier during your development?
Details:
Your project (commit id: 6767b41) directly uses 3 APIs from package tweepy.
tweepy.api.API.__init__, tweepy.auth.OAuthHandler.__init__, tweepy.auth.OAuthHandler.set_access_token
Beginning fromwhich, 1 functions are then indirectly called, including 0 tweepy's internal APIs and 1 outsider APIs as follows:
[/VickiLanger/LGBTQ-of-the-day-bot]
+--tweepy.api.API.__init__
| +--tweepy.parsers.ModelParser.__init__
+--tweepy.auth.OAuthHandler.__init__
| +--requests_oauthlib.OAuth1Session
+--tweepy.auth.OAuthHandler.set_access_token
Since all these functions have not been changed between any version for package "tweepy" from [3.10.0] and 3.9.0. Therefore, we believe it is safe to loosen the corresponding dependency.
Describe the bug
tweet_annual_events.py
is tweeting Today is []
(example)
2020-11-23T17:13:11.861843+00:00 app[scheduler.1873]: Traceback (most recent call last):
2020-11-23T17:13:11.861871+00:00 app[scheduler.1873]: File "tweet_annual_days.py", line 60, in <module>
2020-11-23T17:13:11.861977+00:00 app[scheduler.1873]: tweet_annual_event()
2020-11-23T17:13:11.861978+00:00 app[scheduler.1873]: File "tweet_annual_days.py", line 53, in tweet_annual_event
2020-11-23T17:13:11.862116+00:00 app[scheduler.1873]: event_tweet = tweet_template + list_of_event_tweets[0] # str(list_of_event_tweets) == ['a good day for testing yet another feature in production. We now support annual events with variable dates like "5th Friday of October"']
2020-11-23T17:13:11.862117+00:00 app[scheduler.1873]: TypeError: must be str, not list
I added the str() to line 51 & 53 because both gave TypeError: must be str, not list
. Weird that it gave the error though because it was working fine before that. 458011e#diff-35adfeb78198446941a15787967ce372f9106ac2373e821bcb6d8a5e180456ce
LGBTQ-of-the-day-bot/tweet_annual_days.py
Line 51 in 3196de8
LGBTQ-of-the-day-bot/tweet_annual_days.py
Line 53 in ca761fb
if length_list_event_tweets != 0:
if length_list_event_tweets > 1:
event_tweet = tweet_template + str(choice(list_of_event_tweets))
else:
event_tweet = tweet_template + list_of_event_tweets[0] # str(list_of_event_tweets) == ['a good day for testing yet another feature in production. We now support annual events with variable dates like "5th Friday of October"']
api.update_status(event_tweet)
print('annual event tweet accomplished')
else:
print('no annual event tweet today')
To Reproduce
Currently, running and posting as Today is []
daily at 1130 EST/430 UTC
Expected behavior
It should instead be tweeting the first item of list_of_event_tweets
. Should only tweet the first event in list_of_event_tweets
if there is an event or print to logs no annual event tweet today
Additional context
For reference, the next 3 events are
'12-01': 'Wolrd AIDS day \n #WorldAIDSDay', # http://www.worldaidsday.org/about
'12-08': 'Pansexual Pride Day', # https://www.queerevents.ca/notable-lgbtq-dates#pansexualprideday
'12-10': 'Human Rights Day', # https://www.un.org/en/observances/human-rights-day
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
This same event keeps getting posted, even on days when it shouldn't
Expected behavior
Events should only post on their assigned dates
Don't forget to follow the bot on Twitter to see the hard work you put in.
I would love to see an event for each US state like the below:
'2009-04-03': 'Same-sex marriage is legal in the state of Iowa. https://en.wikipedia.org/wiki/Same-sex_marriage_in_Iowa',
In addition, it would be great to have events like that for all the countries that have made things legal.
All events added should look like the below
'2020-10-04': 'title',
'1969-06-28': 'Stonewall riots https://en.wikipedia.org/wiki/Stonewall_riots',
'2019-09-16', 'words that will be tweeted and a reference link url',
words_dir/historical_events.py
keeping to the existing style/conventions:
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
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.
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.
Describe the enhancement you'd like
Currently get_img_for_tweet.py
uses one font to build the images posted on Twitter.com/LGBTQotd. It would be great if we could use a random font from assets
.
This will require a new file.
https://github.com/VickiLanger/LGBTQ-of-the-day-bot/tree/production/assets
https://github.com/VickiLanger/LGBTQ-of-the-day-bot/blob/production/get_img_for_tweet.py
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
Images being tweeted do not have alt text. Alt text is imperative for making tweets accessible to everyone.
Reference on why alt text is so important
Additional context
Resources that may be helpful:
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
Image text should be centered-ish and have space to breathe. Currently lines spacing and margins are non-existant
Expected behavior
Words should be legible, with space between lines and kinda in the center
It should be fixable in this file: https://github.com/VickiLanger/LGBTQ-of-the-day-bot/blob/production/get_img_for_tweet.py
Additional context
Add any other context about the problem here.
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add events to words_dir/tweet_annual_events.py
When adding events, please place them in order, oldest to newest
If you're adding a hashtag, please include \n
to make the hashtag hop to the next line
Events from all around the world are welcome. If the event is specific to a country, please include the country in the narrative.
events added should look like the below
'MM-DD': 'Name of day \n relevant hashtag', # reference link, if you have one
# November
'11-08': 'Intersex Solidarity Day \n #IntersexSolidarityDay',
'11-20': 'International Transgender Day of Remembrance', # http://tdor.info/about-2/
# December
'12-01': 'Wolrd AIDS day \n #WorldAIDSDay', # http://www.worldaidsday.org/about
# Examples
'08-2U': 'Gay Uncles Day',
'11-1U': 'Trans Parent Day',
For events on a nth day of the month (like 2nd Tuesday of November), the syntax is MM-xY
words_dir/tweet_annual_events.py
keeping to the existing style/conventions:
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Be sure to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
#238 is for adding annual events to words_dir/tweet_annual_events.py
. However, many of these annual events fall on variable days each year.
Describe the solution you'd like
Be able to add events with variable dates like 3rd tuesday of march
in an as easy as possible manner to keep this repo #CodeNewbie friendly
Describe alternatives you've considered
Additional context
Current files:
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
Emojis are in the strings but don't show in the images generated by this file.
I'm thinking it's a font issue, but maybe it's more than just that.
Expected behavior
Show emojis, pretty please
Don't forget to follow the bot on Twitter to see the hard work you put in.
Issue #2 discussed generating images from text with the images in img_bg
. Now that the images are generated with generateImagePost.py
, they need to be able to be tweeted with tweet.py
Is your feature request related to a problem? Please describe.
Although I understand that for the dictionary it would be good to have specific dates to look-up to find facts,
doing that leaves out a lot of other LGBTQ history. Especially those before the common era (BCE).
Describe the solution you'd like
I would like to see either another dictionary containing only centuries as the key or allow nonspecific dates for keys on the original dictionary.
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
Right now, the tweet_historical_event()
function in tweet_historical_events.py
only generates the tweet when the today
's date (YYYY-MM-DD) matches exactly that in the events
list.
To Reproduce
Steps to reproduce the behavior:
tweet_historical_events.py
events
list and the function.Expected behavior
tweet_historical_events()
does not return anything.Desktop (please complete the following information):
Additional context
Describe the bug
An event for 2004-07-20
will post on 04-07
and 07-20
https://twitter.com/lgbtqotd/status/1379660512082944002?s=21
Expected behavior
Only have post on the correct date
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the feature you'd like
Tweet about international/national/visibility/awareness days letting people know those things are happening
Describe things you've considered
tweet_history.py
to tweet this dictionaryAdditional context
It should probably look something similar to https://github.com/VickiLanger/LGBTQ-of-the-day-bot/blob/production/tweet_history.py
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add nouns to words_dir/tweet_nouns.py
In the tweet_nouns.py
file, there are some nouns separated by comments to have different categories.
All nouns should be singular and lower case (unless a proper noun). (eg boot
, not boots
)
Nouns must make sense after "{adjective} {label}" (example: tiny queer [something])
Within categories, please keep in alphabetical order.
All nouns added should look like the below
'noun goes here',
If you're adding a new category of items, do it like this
# category name here
'noun goes here',
'noun goes here',
'noun goes here',
words_dir/tweet_nouns.py
keeping to the existing style/conventions:
noun
word should be singular (eg boot
, not boots
)Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
To Reproduce
Steps to reproduce the behavior:
62
: comma inside stringI won't make a PR because there's only one syntax error. Someone who has a PR up should fix the comma :)
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add more images to the img_bg
directory
Make and add some backgrounds to be used at random for posting on @LGTBTotd on twitter
@LGBTQotd
somewhere on the image101
or numbers with the letter 'a' like 101a
.#0b3c49
a dark blue as the text that will be on them.1600 x 900
16:9
#0b3c49
a dark blue#f2a130
an orangey yellow#444444
a dark gray#86b500
greenish#f4f4f4
almost white, kinda grayimg_bg
keeping to the existing naming conventions:
img_bg
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
get_tweet.py
Is your feature request related to a problem? Please describe.
Currently, the f'string isn't accounting for the proper use of a
and an
.
Describe the solution you'd like
properly decide between a
and an
.
Don't forget to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
Right now, the bot will tweet a random historical event that match a date
Describe the solution you'd like
It would be cool to see that the bot will also generate a thread of these multiple events in chronological order to see how things progresses/setbacks. => insightful.
Additional context
Researching on how to implement this
Describe the bug
Posting of images was an added feature with #90 & #94. The image post great, but there are issues with the text. In get_img_for_tweet.py
, the font is currently set to ImageFont.load_default()
but it needs to use a file from the assets
folder.
Expected behavior
Use font from file from the assets
folder.
Should be able to do this, but Heroku is throwing errors. Not sure if my path isn't right or if it's something with Heroku
font_type = ImageFont.truetype('/assets/Nunito-Regular.ttf', 40)
font_type2 = ImageFont.truetype('/assets/Nunito-Regular.ttf', 40*2)
2020-10-16T12:00:22.737878+00:00 app[scheduler.1478]: font_type = ImageFont.truetype('/assets/Nunito-Regular.ttf', 40)
2020-10-16T12:00:22.737901+00:00 app[scheduler.1478]: File "/app/.heroku/python/lib/python3.6/site-packages/PIL/ImageFont.py", line 836, in truetype
2020-10-16T12:00:22.738235+00:00 app[scheduler.1478]: return freetype(font)
2020-10-16T12:00:22.738236+00:00 app[scheduler.1478]: File "/app/.heroku/python/lib/python3.6/site-packages/PIL/ImageFont.py", line 833, in freetype
2020-10-16T12:00:22.738581+00:00 app[scheduler.1478]: return FreeTypeFont(font, size, index, encoding, layout_engine)
2020-10-16T12:00:22.738582+00:00 app[scheduler.1478]: File "/app/.heroku/python/lib/python3.6/site-packages/PIL/ImageFont.py", line 194, in __init__
2020-10-16T12:00:22.738752+00:00 app[scheduler.1478]: font, size, index, encoding, layout_engine=layout_engine
2020-10-16T12:00:22.738756+00:00 app[scheduler.1478]: OSError: cannot open resource
Screenshots
If applicable, add screenshots to help explain your problem.
Don't forget to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add events to historical_events.py
NOTE: this issue is only for you if you'd consider yourself a Code Newbie.
Have you seen a typo you'd like to fix? Go ahead and fix it.
Need help? Check out this article on using the github website to navigate git or use this repo as an example to use the command line. You're also welcome to comment on this issue and I'll be happy to help.
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add nouns to words_dir/tweet_labels.py
In the tweet_labels.py
file, there are some labels & definitions separated by comments to have different categories.
Here's a good source to work from: https://lgbta.wikia.org/wiki/LGBTA_Wiki
Important: Gatekeeping terms (eg gold star lesbian
, gold star gay
) will not be merged or accepted in any way. Terms like this do not adhere to our Code of Conduct. We make every effort to provide a harassment-free experience with empathy, inclusion, and respect being at the core of the project.
Within categories, please keep in alphabetical order.
All labels added should look like the below
'label': 'definition',
If you're adding a new category of items, do it like this
# category name here
'label': 'definition',
'label': 'definition',
'label': 'definition',
If you would like to add just the label and no definition, that is fantastic. Please do it like below. Leave the key string empty.
# category name here
'label': '',
'label': '',
'label': '',
words_dir/tweet_labels.py
keeping to the existing style/conventions:
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
Currently, a light-colored translucent box is used on top of the background images. It was used as a way to make the words accessible, but it's hindering the legibility in a lot of cases.
Describe the solution you'd like
Generate a background image that complies with WCAG a11y standards.
Describe alternatives you've considered
randomized pride flag colored backgrounds masked to lighten them up and allow for AA accessibility
Additional context
Currently using images in the img_bg
folder. get_img_for_tweet.py
is used to add text to those images.
#2
#250
#147
https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.new
https://alexwlchan.net/2020/03/stripey-flag-wallpapers/
https://alexwlchan.net/2016/10/wallpapers-with-pillow/
https://alexwlchan.net/2016/10/tiling-the-plane-with-pillow/
@LGBTQotd
somewhere on the image#0b3c49
a dark blue as the text that will be on them.1600 x 900
16:9
#0b3c49
a dark blue used for text#f2a130
an orangey yellow#444444
a dark gray#86b500
greenish#f4f4f4
almost white, kinda grayimg_bg
keeping to the existing naming conventions:
img_bg
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
Some nouns, adjectives, labels are being asked repeatedly
Describe the solution you'd like
I'd like the nouns, adjectives, labels to not be repeated so often
here's a similar solution with less moving parts than this repo VickiLanger/code-questions-bot#24
Describe alternatives you've considered
read docs on random() to see if there is a better way
remove each nouns, adjectives, labels from the list until they've all been asked, then add them back in
track nouns, adjectives, labels being used in a database
Additional context
This repo used logs to stop repeating things. Maybe do it like they did
https://github.com/joaquinlpereyra/twitterImgBot/blob/master/twitterbot.py
https://github.com/joaquinlpereyra/twitterImgBot/blob/master/logs/logger.py
Don't forget to follow the bot on Twitter to see the hard work you put in.
Background
The current history tweets just have the date. I think the tweets would be more impactful and incite more feeling from readers if they included how many years ago an event happened. Below is what they currently say
This day in LGBTQ history
https://twitter.com/LgbtQotd/status/1327295355503992834
Describe the solution you'd like
This will take doing some math to calculate the amount of years.
I would like the history tweet adjusted. It should read like below
x years ago on this day in LGBTQ history
LGBTQ-of-the-day-bot/tweet_history.py
Line 23 in 3ae6ff3
Additional context
Add any other context or screenshots about the feature request here.
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the solution you'd like
get_reply.py
to have definitions for each label OR have definitions in tweet_labels.py
Additional context
reply code in tweet.py
needs to uncommented and adjusted as necessary
def main():
api = authenticate_api()
#reply_with = get_reply()
print("finding a tweet...")
tweet = get_tweet()
print("chose tweet: " + tweet)
tweet = api.update_status(tweet) # variable used later for reply to this tweet
print('tweet has been tweeted')
#api.update_status(status=reply_with, in_reply_to_status_id=tweet.id, auto_populate_reply_metadata=True)
#print('chose reply:' + reply_with)
#print('reply has been tweeted')
main()
Don't forget to follow the bot on Twitter to see the hard work you put in.
Currently: https://vickilanger.github.io/LGBTQ-of-the-day-bot/
#0b3c49
a dark blue, most text#f2a130
an orangey yellow#444444
a dark gray#86b500
greenish#f4f4f4
almost white, kinda graySomeone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add events to words_dir/tweet_historical_events.py
All events added should look like the below
'2020-10-04': 'title',
'1969-06-28': 'Stonewall riots https://en.wikipedia.org/wiki/Stonewall_riots',
'2019-09-16', 'words that will be tweeted and a reference link url',
When adding events, please place them in order, oldest to newest
Events from all around the world are welcome. If the event is specific to a country, please include the country in the narrative.
These links may help:
words_dir/tweet_historical_events.py
keeping to the existing style/conventions:
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
Add images that generate when posting. I think it's something to do with open graph. Must have alt text
Both dev.to and webwide have this.
Maybe this is the wizardry behind it? https://lannonbr.com/blog/2019-11-10-og-images/
Don't forget to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
Lots of times, entries to data files contain syntax errors like commas, periods, etc.,
Describe the solution you'd like
Have an automated pre-commit hook that will check for these errors. If there are, the hook won't allow a push => prompts contributors to check their changes.
This -> makes things easier for maintainer/organizer -> good practice of checking code for errors for everyone.
Additional context
Don't forget to follow the bot on Twitter to see the hard work you put in.
Describe the bug
Sometimes text just isn't legible and therefore not accessible.
Expected behavior
Background and text should be verified to be WCAG compliant together before being allowed to post
Screenshots
https://twitter.com/lgbtqotd/status/1321920117551353856
Additional context
A suggested fix I was given:
Don't forget to follow the bot on Twitter to see the hard work you put in.
Is your feature request related to a problem? Please describe.
The history of LGBTQ+ rights in the world happened differently in different countries. I would like to propose
organization of historical events by countries, a way to show the chronological differences in the achievements in rights in different countries.
Describe the solution you'd like
I would like to standardize historical events with the names of the countries.
Describe alternatives you've considered
To carry out this modification it will be necessary to change the dictionary of 'events' and modify 'tweet_historicat_event' to add the name of the country in the tweet.
Don't forget to follow the bot on Twitter to see the hard work you put in.
This will be a running issue to let people know how to add adjectives to words_dir/tweet_adjectives.py
In the words_dir/tweet_adjectives.py
file, there are some adjectives separated by comments to have different categories.
Within categories, please keep in alphabetical order and all lowercase.
All adjectives added should look like the below
'adjective goes here',
If you're adding a new category of items, do it like this
# category name here
'adjective goes here',
'adjective goes here',
'adjective goes here',
words_dir/tweet_adjectives.py
keeping to the existing style/conventions:
Someone will look it over and, if deemed appropriate, will merge your PR.
Thanks for contributing!
Don't forget to follow the bot on Twitter to see the hard work you put in.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.