social-media

Social Media Integration Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "social-media" with this command: npx skills add sgcarstrends/sgcarstrends/sgcarstrends-sgcarstrends-social-media

Social Media Integration Skill

Integrations live in apps/web/src/lib/workflows/social/ .

Supported Platforms: Discord (webhook), LinkedIn (OAuth), Telegram (Bot API), Twitter (API v2)

Integration Patterns

Telegram

export async function postToTelegram(message: string) { const url = https://api.telegram.org/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMessage; await fetch(url, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ chat_id: process.env.TELEGRAM_CHAT_ID, text: message, parse_mode: "Markdown", }), }); }

Twitter

export async function postToTwitter(message: string) { await fetch("https://api.twitter.com/2/tweets", { method: "POST", headers: { "Authorization": Bearer ${process.env.TWITTER_BEARER_TOKEN}, "Content-Type": "application/json", }, body: JSON.stringify({ text: message }), }); }

LinkedIn

export async function postToLinkedIn(message: string) { await fetch("https://api.linkedin.com/v2/ugcPosts", { method: "POST", headers: { "Authorization": Bearer ${process.env.LINKEDIN_ACCESS_TOKEN}, "Content-Type": "application/json", "X-Restli-Protocol-Version": "2.0.0", }, body: JSON.stringify({ author: urn:li:organization:${process.env.LINKEDIN_ORG_ID}, lifecycleState: "PUBLISHED", specificContent: { "com.linkedin.ugc.ShareContent": { shareCommentary: { text: message }, shareMediaCategory: "NONE", }, }, visibility: { "com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC" }, }), }); }

Message Templates

export function createCarDataMessage(data: CarRegistrationData) { return `🚗 Car Registration Update - ${data.month} ${data.year}

📊 Total Registrations: ${data.total.toLocaleString()} 🏆 Top Makes: ${data.topMakes.slice(0, 3).join(", ")}

📈 View: https://sgcarstrends.com/data/${data.year}/${data.month}

#SingaporeCars #CarRegistration`; }

Character Limits

Platform Limit

Twitter 280

LinkedIn 3,000

Telegram 4,096

Discord 2,000 (message), 6,000 (embed)

Environment Variables

TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... TWITTER_BEARER_TOKEN=... LINKEDIN_ACCESS_TOKEN=... LINKEDIN_ORG_ID=...

Error Handling

export async function postToAllPlatforms(message: string) { const results = await Promise.allSettled([ postToTelegram(message), postToTwitter(message), postToLinkedIn(message), ]); const failures = results.filter(r => r.status === "rejected"); if (failures.length > 0) console.error("Posting failures:", failures); }

Debugging

  • Auth errors: Verify env vars, check token expiration

  • Rate limits: Implement retry with backoff

  • Format issues: Check char limits, test markdown support

Best Practices

  • Error Handling: Handle API failures gracefully

  • Rate Limiting: Implement limits to avoid bans

  • Testing: Test on dev/sandbox accounts first

  • Credentials: Never commit tokens

References

  • apps/web/CLAUDE.md for workflow integration details

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Content Repurposer Pro

Repurpose long-form content (blog posts, articles, YouTube transcripts) into multiple formats automatically — Twitter/X threads, LinkedIn posts, email newsle...

Registry SourceRecently Updated
610Profile unavailable
General

AI Viral Trend Hijacker — Detect Any Trend & Produce Content Before It Peaks

Detect real-time viral trends across TikTok, Instagram, Reddit, YouTube, and Google, score and map them to your niche, then generate scripts and produce read...

Registry SourceRecently Updated
860Profile unavailable
General

Social Post

Post to social media platforms using the multi-provider social posting API. Use when user wants to post to Twitter, LinkedIn, Instagram, Facebook, TikTok, Th...

Registry SourceRecently Updated
1390Profile unavailable
General

Xanadu Social Media Manager

Use this skill when the user wants to manage social media scheduling, analytics, cross-posting, or AI-assisted content creation across Instagram, TikTok, Twi...

Registry SourceRecently Updated
1650Profile unavailable