Writing scripts with Reddit API

If you are using a different tool to write your Python code, it makes sense to write the HTML code into a page.with open("puppies.html", "w", encoding='utf-8') as html_page: html_page.write(imghtml)Now, you can navigate the folder your Python code lives and open the appropriately named puppies.html page..See a preview here.ClosingThere is a ton of information that I could not covered in here to keep this post to the point..I was hoping to write a trivia game, where you see a photo and try to guess the subreddit it was shared, but I have to skip it for now..I might do it in another iteration, hopefully.If you have enjoyed the tutorial check my Jupyter notebook to see a full example, where a web page is generated out of a given search query..In one of the upcoming blog posts, I will show you how to write a Reddit bot, that will parse information from two separate APIs and post comments on Reddit.ReferencesPart 2 notebookReddit to Webpage notebookAn example output HTML pageOriginally published at https://alpscode.com/blog/scripting-with-reddit-api/.. More details

Leave a Reply