social-post
Social Posting Skill
Post to multiple social media platforms via a unified social posting API with automatic provider fallback.
Setup
Location: ~/social-posting-api/ (configurable — point to wherever you cloned your posting API)
Environment:
cd ~/social-posting-api
source venv/bin/activate
Required env vars in .env:
You only need one provider to get started. PostForMe is recommended as the primary.
Quick Commands
Check Connected Accounts
from social_posting import SocialPostingClient
from dotenv import load_dotenv
load_dotenv()
client = SocialPostingClient()
print("Providers:", client.available_providers)
for acc in client.get_accounts():
print(f" {acc.platform}: {acc.username}")
Post Text Only
result = client.post(
content="Your post content here",
platforms=["twitter", "linkedin"]
)
print(f"Success: {result.success}, Provider: {result.provider}")
Post with Images
result = client.post(
content="Check out these photos!",
platforms=["instagram"],
media_urls=[
"https://example.com/image1.jpg",
"https://example.com/image2.jpg"
]
)
Schedule a Post
from datetime import datetime
result = client.post(
content="Scheduled post",
platforms=["linkedin"],
scheduled_for=datetime(2025, 1, 15, 9, 0) # UTC
)
Supported Platforms
| Platform | Text Only | With Media | Notes |
|---|---|---|---|
| Twitter/X | ✅ | ✅ | 280 char limit |
| ✅ | ✅ | Best for professional content | |
| ❌ | ✅ | Requires media | |
| ✅ | ✅ | ||
| TikTok | ❌ | ✅ | Video preferred |
| Threads | ✅ | ✅ | |
| Bluesky | ✅ | ✅ | |
| ❌ | ✅ | Requires media | |
| YouTube | ❌ | ✅ | Video only |
Complete Posting Script
#!/usr/bin/env python
"""Post to social media platforms."""
import sys
sys.path.insert(0, '~/social-posting-api') # Update this path
from social_posting import SocialPostingClient
from dotenv import load_dotenv
load_dotenv('~/social-posting-api/.env') # Update this path
def post_to_social(content: str, platforms: list, media_urls: list = None):
"""Post content to specified platforms."""
client = SocialPostingClient()
# Check which platforms are connected
accounts = client.get_accounts()
connected = [a.platform for a in accounts]
# Filter to only connected platforms
valid_platforms = [p for p in platforms if p in connected]
if not valid_platforms:
print(f"No connected accounts for: {platforms}")
print(f"Connected: {connected}")
return None
# Post
result = client.post(
content=content,
platforms=valid_platforms,
media_urls=media_urls
)
if result.success:
print(f"✅ Posted via {result.provider}")
print(f" Post ID: {result.post_id}")
else:
print(f"❌ Failed: {result.error}")
return result
Workflow for Posting
Step 1: Check Connected Accounts
Always check what's connected first:
cd ~/social-posting-api
source venv/bin/activate && python -c "
from social_posting import SocialPostingClient
from dotenv import load_dotenv
load_dotenv()
client = SocialPostingClient()
for acc in client.get_accounts():
print(f'{acc.platform}: {acc.username}')
"
Step 2: Prepare Content
- Twitter: Keep under 280 chars
- LinkedIn: Can be longer, professional tone
- Instagram: Needs at least 1 image
- Xiaohongshu: Use
xhs-image-genskill for carousel content
Step 3: Execute Post
source venv/bin/activate && python -c "
from social_posting import SocialPostingClient
from dotenv import load_dotenv
load_dotenv()
client = SocialPostingClient()
result = client.post(
content='''Your content here''',
platforms=['platform1', 'platform2'],
media_urls=['https://example.com/image.jpg'] # Optional
)
print(f'Success: {result.success}')
print(f'Provider: {result.provider}')
print(f'Post ID: {result.post_id}')
"
Connecting New Accounts
Via PostForMe (Primary)
- Go to https://postforme.dev/dashboard
- Click "Connect Account"
- Select platform and authorize
Via LATE (Fallback)
- Go to https://getlate.dev/dashboard
- Connect social accounts
- API key in
.envwill auto-detect new accounts
Error Handling
| Error | Cause | Solution |
|---|---|---|
| "No connected accounts" | Platform not linked | Connect via provider dashboard |
| "Instagram requires media" | Text-only post | Add at least 1 image URL |
| "HTTP 401" | Invalid API key | Check .env file |
| "All providers failed" | Both providers down | Try again later |
Cross-Posting Strategy
For open source announcements:
result = client.post(
content="🚀 Just open-sourced my project!\n\nGitHub: https://github.com/yourusername/your-repo",
platforms=["twitter", "linkedin"]
)
For visual content:
# Multi-image post
result = client.post(
content="Behind the scenes 🔧",
platforms=["instagram"],
media_urls=[
"https://example.com/image1.jpg",
"https://example.com/image2.jpg",
]
)
More from phy041/claude-agent-skills
github-monitor
Monitor your GitHub repos for new projects and significant updates. Generates Reddit + Twitter draft posts for approval before publishing. Triggers on "check my github", "github monitor", "new repos", or any GitHub monitoring request.
2ship-digest
Detect new GitHub repos and generate formatted ship announcements for social media. Monitors your GitHub profile for new repos pushed today, writes a technical digest, and drafts Twitter/Reddit posts for approval. Triggers on "ship digest", "new repos", "what did I ship", "github ship", or any shipping announcement request.
1reddit-cultivate
Reddit account cultivation for founders and indie developers. Uses AppleScript to control real Chrome — undetectable by anti-bot systems. Checks karma, finds rising posts, drafts comments, and posts directly. Triggers on "/reddit-cultivate", "check my reddit", "reddit maintenance", "find reddit opportunities", "build reddit karma".
1twitter-cultivate
Twitter/X account cultivation and growth system. Checks account health (TweepCred, shadowban), analyzes tweets, finds engagement opportunities, recommends unfollows, and tracks progress. Triggers on "/twitter-cultivate", "check my twitter", "twitter health", "grow my twitter", "twitter maintenance", "fix my twitter reach".
1