The instagram bot account got banned so I made a web frontend instead. Check it out!
Generates a random philosophical quote using a Markov chain I wrote in C++ then scrapes the web for a random photo. The text is overlayed then the image is posted to Instagram using a bot.
Example Post
quoteScraper.py will navigate to "https://www.goodreads.com/quotes/tag/philosophy" and use an lxml tree to find all the content pertaining to quotes.
To do this, I create an lxml tree with the given parameters: /div[@class="quoteText"]/text() Using this tree I can use RegEx to find only the information nested between quotation marks.
Before RegEx:
After RegEx:
I fed all the web-scraped philosophy quotes into my Markov chain generator to create 1,000,000 quotes that mimic the syntax and word choice of the original philosophical quotes, however these sentences are uniquely made.
example sentences:
- "A convention is a third which neither comprehends by itself nor by the underlying population."
- "Body is a futile exercise."
- "We all have the perfect crime."
- "Happiness consists in love."
Using a random Unsplash fetch url: https://source.unsplash.com/random/1080x1080/?nature I can essentially grab a random 1080x1080 (1:1) image to use with the Markov-generated quote.
Login as an Instagram agent using Username and Password and proceed to post our image.