Thursday, August 15, 2024

Webhooks Post to Blogger Using Curl

Using make.com to send webhook with the json body of "Title" and "Content".

create a bash script that uses curl to send to that webhook


#!/bin/bash

# Prompt for title
read -p "Enter the title: " title

# Prompt for content
read -p "Enter the content: " content

# Send the POST request using curl
curl -X POST https://hook.us1.make.com/YOURWEBHOOKGOESHERE!!! \
     -H "Content-Type: application/json" \
     -d "$(printf '{"title": "%s", "content": "%s"}' "$title" "$content")"

chmod and move it


chmod +x blogpost.sh
sudo mv blogpost.sh /usr/local/bin/blogpost

Now you should be able to type blogpost anytime in the terminal and post away no need for the browser

No comments:

Post a Comment