This Google Apps Script automates the creation, approval, and posting of LinkedIn content using GPT‑4o, Telegram, and Google Sheets. It allows you to share article URLs, generate impactful posts with AI, get approvals via Telegram, and schedule posts to LinkedIn using Zapier.
- 🔗 Input an article URL in Google Sheets
- 💬 GPT‑4o generates summary + LinkedIn-style post with tone control
- 📲 Approval via Telegram with ✅ Approve / ❌ Reject buttons
- 🕓 Auto-scheduling to your LinkedIn profile using Zapier
- 🛡 Rate-limited, robust error handling, and retry logic
Google Forms ─▶ Google Sheets ─▶ Apps Script ─▶ GPT‑4o (OpenAI)
│ │
│ └──▶ Telegram Bot (Approval)
│
└──▶ Zapier (Scheduled LinkedIn Post)
| Column | Header | Purpose |
|---|---|---|
| A | Timestamp | Auto-generated |
| B | URL | Article link input |
| C | Tone | Witty, Professional, Casual, etc. |
| D | Summary | Auto-generated |
| E | Post | AI-generated post |
| F | Status | Running, Pending, Sent, Approved, Rejected |
- Open script.new
- Paste the contents of
linked_in_auto_post_gas.js - Link it to your Google Sheet (or create one using the column layout above)
Under Apps Script > Project Settings > Script Properties, add:
| Key | Value |
|---|---|
OpenAPISecret |
Your OpenAI API key |
TelegramBotToken |
From @BotFather |
TelegramChatIDs |
Comma-separated chat IDs |
TelegramWebHookSecret |
Your custom shared secret |
- Deploy as Web App:
- Execute as: Me
- Who has access: Anyone
- Copy your deployment URL
- Run this:
https://api.telegram.org/bot<YOUR_TOKEN>/setWebhook?url=<WEB_APP_URL>?tgSecret=<TelegramWebHookSecret>
- Google Sheets → New or Updated Row
- Filter:
Status = Approved
- LinkedIn → Create Share Update (Profile)
- Google Sheets → Update row: set
Status = Posted
Example Zapier flow included in
/assets/zapier-flow.png
Run this once to install both triggers:
installTriggers()onFormSubmit→ Runs when form is submittedprocessPending→ Hourly sweep of missed rows
- Post-edit suggestion via Telegram
- Analytics feedback loop from LinkedIn
- Tone scoring / performance tracking
- Slack notification integration
MIT © 2025 Hardik Patel