DEV Community

Cover image for Automate Posting in Blogger in Seconds
Gaurav kushwaha
Gaurav kushwaha

Posted on

Automate Posting in Blogger in Seconds

I have setup auto posting my article on blogger using python and here are the steps...

1. Get your blog id first.

For this open view source page of your blog and find this line
<link rel="service.post" type="application/atom+xml" title="Shopping Gennie - Atom" href="https://www.blogger.com/feeds/293367/posts/default">

Here 293367 is your blog id.

2. Install EasyBlogger library to interact with blogger

  • Run command
pip install EasyBlogger
Enter fullscreen mode Exit fullscreen mode
  • After installation, add open cmd and run this command to install additional dependencies else you will see this error message:

Error

winget install pandoc
Enter fullscreen mode Exit fullscreen mode
  • After that run this command:
easyblogger --blogid <blogid> get
Enter fullscreen mode Exit fullscreen mode

example: easyblogger --blogid 293367 get

This will open a browser. You may see a chrome warning that it can't be run as root - but you can ignore that.

auth

You will need to repeat the OAuth2 authorization process if you ever change the blog, or revoke permissions or if the auth token expires.

make sure to install pandoc too, if throws error till now

All set !

3. Write Script to post it

Let’s start by getting files from the blog. You can do that with

easyblogger --blogid <blogid> get
Enter fullscreen mode Exit fullscreen mode

This will print out all the titles of the posts along with their post-id’s

4330888278066099970,OnePlus Nord N200 | 5G Unlocked Android Smartphone U.S Version | 6.49" Full HD+LCD Screen | 90Hz Smooth Display | Large 5000mAh Battery | Fast Charging | 64GB Storage | Triple Camera,Blue Quantum,http://shoppingennie.blogspot.com/2022/10/oneplus-nord-n200-5g-unlocked-android.html

And to fetch just one post, grab a postid from above and run,

easyblogger --blogid <blogid> get -p 437344021642199000 -d markdown
Enter fullscreen mode Exit fullscreen mode

3. Make a python script to auto posting

I have already made for you if you want to do amazon product posting in blog else change html content that's it.

Script link:Here

Simply add your blog id in script, and you are ready to auto post your article.

Let me if you find any error and doubts. Connect me here: https://twitter.com/ravvkush

Top comments (0)