A Python program that reads pretalx schedule JSON exports and generates social media posts for Twitter, Bluesky, and Mastodon platforms.
- Multi-platform support: Generates posts optimized for Twitter (280 chars), Bluesky (300 chars), and Mastodon (500 chars)
- Smart formatting: Automatically adjusts content length and format for each platform
- Contextual hashtags: Automatically generates relevant hashtags based on talk content, track, and keywords
- CSV export: Export posts as CSV files for Buffer.com bulk scheduling
- Flexible input: Supports standard pretalx JSON export formats
- Customizable: Configurable event details, hashtags, and URLs
- Date filtering: Option to generate posts for specific dates
- Organized output: Saves posts to separate files for each platform
The program intelligently generates contextual hashtags based on:
- Talk track: Maps conference tracks to relevant hashtags (e.g., "Security and Privacy" → #security #privacy)
- Keywords: Scans talk titles and abstracts for technology keywords (e.g., "Python" → #python, "Kubernetes" → #kubernetes)
- Content analysis: Identifies relevant topics like #ai, #devops, #web, #cli, etc.
- Character limits: Dynamically adjusts hashtag count based on platform limits
Examples of contextual hashtags:
- "SSH Certificates" →
#SeaGL2025 #security #ssh #infosec - "Duality of Python" →
#SeaGL2025 #programming #python #FLOSS - "Observability Datastores" →
#SeaGL2025 #cloud #observability #database - "Nextcloud Development" →
#SeaGL2025 #programming #nextcloud #api
This program requires Python 3.6+ and uses only standard library modules, so no additional dependencies are needed.
git clone <repository-url>
cd seagl-sns-generatorpython3 main.py schedule.jsonThis will:
- Parse the pretalx schedule JSON file
- Generate social media posts for all platforms
- Save the posts to the
output/directory
python3 main.py schedule.json \
--event-name "SeaGL 2025" \
--event-hashtag "#SeaGL2025" \
--event-url "https://seagl.org" \
--output-dir "social_posts" \
--filter-date "2025-10-10"schedule_file: Path to the pretalx schedule JSON file (required)--event-name: Name of the event (default: "SeaGL")--event-hashtag: Main event hashtag (default: "#SeaGL")--event-url: Event website URL (default: "https://seagl.org")--output-dir: Output directory for generated posts (default: "output")--filter-date: Filter talks for specific date in YYYY-MM-DD format
--csv-export: Enable CSV export for Buffer.com bulk import--posts-per-day: Number of posts per day for scheduling (distributed 9 AM - 9 PM)--image-base-url: Base URL for images (combined with slug/code + .png)--image-field: Field to use for image filename (choices: "slug", "code", default: "slug")
Generate CSV files for bulk importing into Buffer.com:
# Basic CSV export
python3 main.py schedule.json --csv-export
# CSV with scheduled posting (3 posts per day, 9 AM - 9 PM)
python3 main.py schedule.json --csv-export --posts-per-day 3
# CSV with images
python3 main.py schedule.json --csv-export \
--image-base-url "https://seagl.org/images" \
--image-field "slug"The program generates three text files in the output directory:
twitter_posts.txt: Posts optimized for Twitter (280 character limit)bluesky_posts.txt: Posts optimized for Bluesky (300 character limit)mastodon_posts.txt: Posts optimized for Mastodon (500 character limit)
twitter_buffer_import.csv: Twitter posts for Buffer.com importbluesky_buffer_import.csv: Bluesky posts for Buffer.com importmastodon_buffer_import.csv: Mastodon posts for Buffer.com import
Each CSV includes columns: text, image_url, tags (always empty), posting_time
Each file contains all posts for that platform with character count information.
The program supports multiple pretalx schedule export formats:
The program automatically handles the real pretalx export format used by conferences:
{
"schedule": {
"conference": {
"days": [
{
"date": "2025-11-07",
"day_start": "2025-11-07T04:00:00-08:00",
"rooms": {
"Room Name": [
{
"title": "Talk Title",
"date": "2025-11-07T09:10:00-08:00",
"start": "09:10",
"duration": "00:30",
"persons": [
{"public_name": "Speaker Name"}
],
"abstract": "Talk description...",
"url": "https://example.com/talk"
}
]
}
}
]
}
}
}For custom schedules or simplified data:
{
"talks": [
{
"title": "Talk Title",
"speakers": ["Speaker Name"],
"start": "2025-10-10T09:00:00-07:00",
"duration": "45",
"room": "Room Name",
"track": "Track Name",
"abstract": "Talk description...",
"url": "https://example.com/talk"
}
]
}The program handles both formats automatically.
📅 [Time]: "[Title]" by [Speaker(s)] in [Room] #SeaGL2025 #[contextual] #[hashtags] [URL]
🎤 Upcoming at SeaGL:
📍 [Time] on [Date]
🗣️ "[Title]"
👥 Speaker(s): [Speaker(s)]
📍 Room: [Room]
🏷️ Track: [Track]
📝 [Abstract snippet...]
#SeaGL2025 #[contextual] #[hashtags] #[based] #[on] #[content]
🔗 [URL]
The hashtags are dynamically generated based on talk content, replacing generic tags with relevant ones like #python, #kubernetes, #security, #ai, etc.
Try the program with the included sample data:
python3 main.py sample_schedule.jsonThis will generate example posts for a fictional SeaGL schedule.
The program uses several default hashtags and formatting options that can be modified in the SocialMediaPostGenerator class:
common_hashtags: Additional hashtags to include- Post templates and formatting
- Character limits and truncation logic
- Date/time formatting
The program handles common issues gracefully:
- Missing or invalid JSON files
- Incomplete talk data
- Character limit violations
- Missing speaker or time information
Feel free to submit issues and enhancement requests!
This project is open source. Please check the LICENSE file for details.