Lab Activity 4: The Final Connection
Section 4: The Publishing Bot & Social Sync
🎯 Objective
Connect your folder monitor script to the internet by extending it to send processed files and AI-generated text captions to a social media scheduling endpoint using a webhook.
⏱️ Time Allocation
- Webhook Retrieval: 10 minutes
- Script Modification & Test: 30 minutes
🛠️ Materials Required
- Scheduling platform endpoint (e.g., Buffer, Make.com, or Zapier webhook URL).
- Google Antigravity workspace (with the
file_monitor.pyscript).
📋 Step-by-Step Instructions
- Obtain Your Webhook URL:
- Open your Zapier or Make.com dashboard.
- Create a new webhook trigger.
- Copy the unique HTTP URL.
- Instruct Antigravity to Modify the Script:
- In the Antigravity prompt interface, tell the agent:
"Modify the file_monitor.py script. When a file is processed, send an HTTP POST request to this webhook URL: [Insert Webhook URL]. The body of the post should contain the file name, the file size, and a sample caption 'New post auto-published by AI automation!'."
- Review code adjustments:
- Inspect the diff showing the imported
requestslibrary and the webhook code block. - Click Approve.
- Deploy and Verify:
- Run the updated script.
- Drop a new file into
raw_assets/. - Check your webhook platform dashboard to verify the webhook fired and the details were received.
🗣️ Debrief Questions
- What is the difference between a local automation and a cloud-connected automation?
- How can we extend this to send the actual file contents (binary data) instead of just the metadata?