Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generating images for posts #2

Closed
VickiLanger opened this issue Sep 16, 2020 · 14 comments
Closed

Add generating images for posts #2

VickiLanger opened this issue Sep 16, 2020 · 14 comments
Labels
enhancement New feature or request Hacktoberfest Requesting input/assistance from anyone

Comments

@VickiLanger
Copy link
Owner

VickiLanger commented Sep 16, 2020

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/

Images are in img_bg folder.

Thanks for contributing!

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

@VickiLanger VickiLanger added enhancement New feature or request Hacktoberfest Requesting input/assistance from anyone labels Sep 16, 2020
@iriyagupta
Copy link

iriyagupta commented Sep 27, 2020

Hi ! Can you explain this a bit? @VickiLanger

@VickiLanger
Copy link
Owner Author

VickiLanger commented Sep 28, 2020

Absolutely, @iriyagupta. Right now, tweet.py sends a string f"today's queerness is a {adjective} {label} {noun}" to Twitter. I'd like for this string to show up on a random image from the img_bg folder.

I have no clue how to generate the image and I've put very little thought into how it could be done.

Ways I've thought about doing it:

  1. This twitter bot by @joemfox generates images, though I'm not sure how. I haven't looked. that bot's repo
  2. Lots of sites like webwide.io and dev.to have images that generate when links are posted. I don't want links, but I'm sure similar could be done. They're doing it with open graph, I think.

@iriyagupta
Copy link

iriyagupta commented Sep 28, 2020

@VickiLanger So is it like if the image with a text is already available let us say the text is "Today's queerness is a purring biromantic walkman" it should also generate the image 98 which is containing the same text or if the text is not available on the image from the img_bg folder, you want any random image with no text on it to appear and display the string sent by tweet.py?

@VickiLanger
Copy link
Owner Author

VickiLanger commented Sep 28, 2020

@iriyagupta The images in the folder are all blank. I'd like it to grab a random image and show the string on the image

@iriyagupta
Copy link

@VickiLanger Oh okay, understandable. I will give it a try

@iriyagupta
Copy link

@VickiLanger do we have a registered consumer key for the application? Or shall I create my own

@VickiLanger
Copy link
Owner Author

@iriyagupta I have keys. I'm not sure how to share them without sharing them publically. I think you should be able to use authenticate_api from tweet.py https://github.com/VickiLanger/Queer-of-the-day-bot/blob/production/tweet.py.

@iriyagupta
Copy link

@VickiLanger Without keys authenticate_api doesn't seem to work, is there anywhere we can share them?

@VickiLanger
Copy link
Owner Author

You're right. It won't work locally without the keys. Sharing keys poses a security risk. It would be best to get keys of your own, if need be. I got my keys through https://developer.twitter.com/en/apps

reference: https://twitter.com/grahamcox82/status/1311742466429722626?s=20

@iriyagupta
Copy link

@VickiLanger So I have applied for twitter developer account but it will take some time to get accepted, before that I won't be able to run this due to the lack of auth key

@VickiLanger
Copy link
Owner Author

Sounds great. I understand

@tahazanzibarwala
Copy link
Contributor

@VickiLanger are you facing an issue posting an image to Twitter or generating the image with the text itself?

@VickiLanger
Copy link
Owner Author

@tahazanzibarwala Generating the image itself

VickiLanger pushed a commit that referenced this issue Oct 6, 2020
AhmedOssama22dev added a commit to AhmedOssama22dev/Queer-of-the-day-bot that referenced this issue Oct 7, 2020
@AhmedOssama22dev
Copy link
Contributor

Hey @VickiLanger , i wrote some utility functions that may help and with very few customizations you can change the font:style,color,size and the positions.
The methods do the following:1]Choose a random image from img_bg folder
2]Write text on the image in the blank area. [text are classified into -short ,-long]
3]The image object is returned for any operations also its name for saving it locally in the current dir.
I hope my code may help you =)
#78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest Requesting input/assistance from anyone
Projects
None yet
Development

No branches or pull requests

4 participants