Skip to content

A bot to convert top threads of reddit to instagram photos

Notifications You must be signed in to change notification settings

sagarkarira/quotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

instared

A bot to convert top threads of reddit to instagram photos

TODO

The task is to make a bot that would fetch the top thread of /r/ShowerThoughts and convert it to image. Post it to instagram.

This is the basic MVP idea. More things can be done. But lets build this first.

Fetching Data (Reddit API) Easy

Text to Image Challenging

So this the is the RDS of the app.

The idea is to convert the text to an image. I have found various libraries and methods which can help with this task. But the goal is to find the most flexible method, which provide

  • Using JIMP :

    • Jimp does not have any dependencies. Written in pure JS it can write text over an image. It also provides various image filtering and editing functionalities.
  • Using Canvas :

    • Using node-canvas to generate a canvas at the server side. Convert it to the image.

    • Canvas has tonnes of methods to generate anything you want.

    • I tried to hack this : https://codepen.io/sagark/pen/Njxmvj

  • Server Side Rendering :

    • Using a template engine (preferably EJS) rendering a dynamic page, by passing text, background parameters like gradient colors, user name and other variables.

    • Using Pageras to take the screen shot of the dynamic generated page.

    • Provides huge flexibility with html and css as passing variables to ejs file and changing the to create dynamic pages.

    Made this template Disclaimer : I suck at CSS

How to choose background ?

  • Gradient Images :

  • Intelligent Images :

    • Find keywords from the text using [natural](https://githu b.com/NaturalNode/natural)

    • Search keywords in unsplash to find an image. Using it as a background.

  • How to choose text colors?

Posting Image (Instagram API) Easy

*  Will update later. 

Other Resources :

About

A bot to convert top threads of reddit to instagram photos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published