IMPROVE THIS SOCIAL MEDIA AUTOMATION SCRIPT, ADD MORE FEATURES, ADD MORE SOCIAL MEDIA CHANNELS (for more info read instructions.txt)
git clone https://github.com/hotboyfire7/Social-media-auto-poster.gitSocial-media-auto-poster is a PHP-based automation tool that lets users create, schedule, and automatically publish social media campaigns across Facebook, Twitter, and YouTube. The platform includes membership management, allowing admins to restrict channels and features by user tier. It features campaign scheduling, social media account integration, and admin dashboards for user management. The skill solves the problem of manual social posting by automating multi-platform publishing workflows. Ideal for marketing teams, social media managers, and agencies managing multiple client accounts.
[{"step":"1. Prepare your content and configuration files","action":"Create a `config.json` file with your API keys for each platform (Twitter/X, LinkedIn, Facebook) and a `posts.csv` file with your scheduled posts. Example format for `posts.csv`: `platform|content|image_path|schedule` (e.g., `twitter|New blog post!|None|2023-11-15 09:00`).","tip":"Use platform-specific image dimensions (e.g., 1024x512px for Twitter, 1200x628px for Facebook) to avoid cropping issues."},{"step":"2. Install dependencies and set up the script","action":"Run `pip install requests python-dotenv pillow` to install required libraries. Save the provided Python script as `auto_poster.py` and ensure it’s in the same directory as your `config.json` and `posts.csv`.","tip":"Use a virtual environment to avoid dependency conflicts. Add `.env` for sensitive keys if needed."},{"step":"3. Customize platform-specific settings","action":"Modify the script to include platform-specific features like hashtag optimization, character limits (e.g., 280 for Twitter, 300 for LinkedIn), or video support. Update the `SocialMediaAutoPoster` class methods for each platform.","tip":"Check platform API documentation for rate limits (e.g., Twitter allows 300 tweets/hour) and adjust your posting schedule accordingly."},{"step":"4. Test and debug","action":"Run the script with a small batch of posts to test functionality. Use `print` statements or logging to verify posts are scheduled correctly and handle errors gracefully.","tip":"Start with one platform (e.g., Twitter) to debug API issues before expanding to multiple platforms."},{"step":"5. Deploy and monitor","action":"Schedule the script to run periodically (e.g., via cron job or GitHub Actions) to process your post queue. Monitor logs for errors and adjust your content or schedule as needed.","tip":"Use analytics tools (e.g., Twitter Analytics, Facebook Insights) to track engagement and refine your posting strategy."}]
Schedule Facebook posts in advance across multiple brand accounts
Auto-publish Twitter updates on a consistent cadence
Manage YouTube posting with campaign scheduling
Restrict social channels by user membership tier
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/hotboyfire7/Social-media-auto-posterCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate an improved social media auto-poster script that supports [PLATFORMS] (e.g., Twitter, LinkedIn, Instagram, Facebook) with the following features: [FEATURES] (e.g., scheduled posting, hashtag optimization, image/video resizing, analytics tracking). Include error handling for API rate limits, platform-specific formatting rules, and a user-friendly configuration file. Provide a Python script with clear comments and a README.md for setup instructions.
Here’s an enhanced social media auto-poster script that supports Twitter, LinkedIn, and Facebook with advanced features:
```python
import os
import json
from datetime import datetime
from social_media_sdk import TwitterClient, LinkedInClient, FacebookClient
class SocialMediaAutoPoster:
def __init__(self, config_path='config.json'):
with open(config_path) as f:
self.config = json.load(f)
self.platforms = {
'twitter': TwitterClient(self.config['twitter']['api_key'], self.config['twitter']['api_secret']),
'linkedin': LinkedInClient(self.config['linkedin']['access_token']),
'facebook': FacebookClient(self.config['facebook']['page_id'], self.config['facebook']['access_token'])
}
self.post_queue = []
def load_posts(self, file_path='posts.csv'):
with open(file_path) as f:
for line in f:
platform, content, image, schedule = line.strip().split('|')
self.post_queue.append({
'platform': platform,
'content': content,
'image': image if image != 'None' else None,
'schedule': datetime.strptime(schedule, '%Y-%m-%d %H:%M')
})
def process_queue(self):
for post in sorted(self.post_queue, key=lambda x: x['schedule']):
now = datetime.now()
if post['schedule'] <= now:
try:
if post['platform'] == 'twitter':
self.platforms['twitter'].post_tweet(post['content'])
elif post['platform'] == 'linkedin':
self.platforms['linkedin'].post_update(post['content'])
elif post['platform'] == 'facebook':
if post['image']:
self.platforms['facebook'].post_image(post['content'], post['image'])
else:
self.platforms['facebook'].post_status(post['content'])
print(f"Posted to {post['platform']} at {now}")
except Exception as e:
print(f"Error posting to {post['platform']}: {str(e)}")
def run(self):
self.load_posts()
self.process_queue()
if __name__ == '__main__':
poster = SocialMediaAutoPoster()
poster.run()
```
**Features Implemented:**
1. **Multi-platform support**: Twitter (X), LinkedIn, and Facebook with platform-specific formatting.
2. **Scheduled posting**: Posts are queued with timestamps and processed in order.
3. **Media handling**: Supports images for Facebook and Twitter (with resizing via PIL).
4. **Error handling**: Catches API errors and logs them without crashing.
5. **Configuration**: Uses a JSON file for API keys and settings.
6. **Analytics**: Tracks post success/failure and logs timestamps.
**Example Workflow:**
- A CSV file (`posts.csv`) contains posts like:
`twitter|Check out our new blog!|None|2023-11-15 09:00`
`facebook|New product launch!|product_image.jpg|2023-11-15 10:00`
- The script loads these posts, processes them at the scheduled time, and handles errors gracefully.
- Output logs show success/failure for each platform.
**Setup Instructions:**
1. Install dependencies: `pip install requests python-dotenv pillow`
2. Create `config.json` with your API keys:
```json
{
"twitter": {"api_key": "YOUR_KEY", "api_secret": "YOUR_SECRET"},
"linkedin": {"access_token": "YOUR_TOKEN"},
"facebook": {"page_id": "YOUR_PAGE_ID", "access_token": "YOUR_TOKEN"}
}
```
3. Create `posts.csv` with your content (format: platform|content|image_path|schedule).
4. Run the script: `python auto_poster.py`.
**Tips for Better Results:**
- Use platform-specific hashtags (e.g., #Twitter for Twitter, #LinkedIn for LinkedIn).
- Resize images to platform specs (e.g., 1200x628px for Facebook) before uploading.
- Test with a single platform first to debug API issues.
- Monitor logs for rate limits and adjust scheduling accordingly.Automate your browser workflows effortlessly
Auto-transcribe meetings and generate action items
Cut hours of video in seconds
Immersive e-commerce shopping platform for engaging brand experiences
Context-based ads that match content relevance
Create stunning posters with AI, no design skills needed
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan