DEV Community

Cover image for Blog Automation using Python🐍& Blogger
John Pinto
John Pinto

Posted on

Blog Automation using Python🐍& Blogger

I was wondering what are the things I could automate with python.

I know A LOT! 😝😝

🧐 How about movies??

I had nothing specific in mind, but I know I could build something.

We all use Wikipedia a lot for many topics and movies being one of them , an idea clicked.

I'd like reading movie plots alot why not scrape the Plot section of the movie articles and build a website to read only movie plots??

Felt like doing something creative is a good exercise, but what movies??

With the Wikipedia a part already figured out, luckily I discovered python package for IMDb. So there is a module to fetch top200 movies list from IMDb using python.

Now

  • wikipedia(data scraping, python package, api)
  • imdb(python package) What about the website??

I'm not gonna spend $$$ for my side-project that much, instead decided to use bloggerAPI service, which allows use to create free blog websites with Google.

I can create a blogger website with a click and use it's API to upload posts.

🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞🎞

Workflow

It's very simple:

  • Fetch top200 movie title list

  • For each movie title, check if the title has topic "movie"

  • If yes, get the article(url+python) from wikipedia, and scrape the data between Plot section and the Cast section. I said between Plot and cast since the html structure of Wikipedia articles makes it difficult scrape the particular section but, since all the movies articles almost follow the same pattern, that is the decision I made.

  • Finally, bloggerAPI. Nothing special here:

    • Create a project in the Google API Console
    • Enable the Blogger API for your project
    • Create an API key and OAuth 2.0 Client ID

That's it! Run the script which will take care of the rest.

The Blogger Website : https://movieplotzz.blogspot.com/

Here is the github : https://github.com/pj8912/wiki-blog-automation clone it and follow the instructions to automate the process of creating your own movie plots website and have fun! πŸ˜‰

Top comments (0)