{"id":23589103,"url":"https://github.com/decryptu/ghost-autoblogger-bot","last_synced_at":"2025-05-07T12:47:37.149Z","repository":{"id":269321873,"uuid":"860346978","full_name":"Decryptu/ghost-autoblogger-bot","owner":"Decryptu","description":"An automated Ghost CMS content generator that transforms the latest English AI news articles into engaging French content. This bot fetches current AI news, translates and adapts it into French using OpenAI's language models, and pairs it with relevant imagery from Unsplash to create draft posts for your Ghost blog.","archived":false,"fork":false,"pushed_at":"2025-01-24T08:24:20.000Z","size":43,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T02:40:03.063Z","etag":null,"topics":["autoblog","autoblogger","blog","bot","ghost","ghost-cms"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Decryptu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-20T09:09:36.000Z","updated_at":"2025-03-29T08:51:16.000Z","dependencies_parsed_at":"2024-12-22T18:39:46.754Z","dependency_job_id":null,"html_url":"https://github.com/Decryptu/ghost-autoblogger-bot","commit_stats":null,"previous_names":["decryptu/ghost-autoblogger-bot"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fghost-autoblogger-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fghost-autoblogger-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fghost-autoblogger-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Decryptu%2Fghost-autoblogger-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Decryptu","download_url":"https://codeload.github.com/Decryptu/ghost-autoblogger-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252882485,"owners_count":21819150,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autoblog","autoblogger","blog","bot","ghost","ghost-cms"],"created_at":"2024-12-27T06:12:56.200Z","updated_at":"2025-05-07T12:47:37.111Z","avatar_url":"https://github.com/Decryptu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ghost Autoblogger Bot 🤖\n\nAn automated content generation system for Ghost blogs that fetches AI news, translates them to French, and publishes them automatically using OpenAI's GPT-4o.\n\n## Features\n\n- 🔄 Automatically fetches the latest AI news using NewsAPI\n- 🤖 Generates high-quality French articles using OpenAI's GPT-4o\n- 🖼️ Adds relevant featured images from Unsplash\n- 📝 Saves articles locally as markdown files\n- 🚀 Publishes directly to your Ghost blog\n- ⏰ Runs on a schedule (default: twice daily at 7 AM and 7 PM)\n- 🏷️ Automatically adds relevant tags\n- 📊 Includes error handling and logging\n\n## Prerequisites\n\n- Node.js (v14 or higher)\n- A Ghost blog with Admin API access\n- API keys for:\n  - OpenAI\n  - NewsAPI\n  - Unsplash\n  - Ghost Content API\n  - Ghost Admin API\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/Decryptu/ghost-autoblogger-bot.git\ncd ghost-autoblogger-bot\n```\n\n2. Install dependencies:\n\n```bash\nnpm install\n```\n\n3. Create a `.env` file in the root directory:\n\n```env\nOPENAI_API_KEY=your_openai_key\nGHOST_API_URL=your_ghost_url\nGHOST_CONTENT_API_KEY=your_ghost_content_key\nGHOST_ADMIN_API_KEY=your_ghost_admin_key\nUNSPLASH_ACCESS_KEY=your_unsplash_key\nNEWS_API_KEY=your_news_api_key\n```\n\n## Usage\n\n### Local Development\n\nRun the bot immediately:\n\n```bash\nnode bot.js --run\n```\n\n### Production Deployment\n\nFor production, it's recommended to use PM2:\n\n1. Install PM2:\n\n```bash\nnpm install -g pm2\n```\n\n2. Start the bot:\n\n```bash\npm2 start ecosystem.config.js\n```\n\n3. Monitor the bot:\n\n```bash\npm2 logs ghost-autoblogger\n```\n\n### Configuration\n\nEdit `config.js` to customize:\n\n- OpenAI model\n- Article prompt\n- Schedule timing\n- Default image URL\n- Author ID\n\n## File Structure\n\n```\n├── bot.js              # Main bot logic\n├── config.js           # Configuration settings\n├── ecosystem.config.js # PM2 configuration\n├── .env               # Environment variables\n└── generated_articles/ # Local storage for generated articles\n```\n\n## Generated Content\n\nArticles are saved in two places:\n\n1. Locally in the `generated_articles` folder as markdown files\n2. Published directly to your Ghost blog\n\n## Customization\n\n### Changing the Schedule\n\nEdit `CRON_SCHEDULE` in `config.js`. Default is twice daily (`0 7,19 * * *`).\n\n### Modifying the Article Style\n\nEdit `ARTICLE_PROMPT` in `config.js` to change the tone, style, or format of generated articles.\n\n### Changing Tags\n\nModify the tags array in the `publishToGhost` function in `bot.js`.\n\n## Error Handling\n\nThe bot includes comprehensive error handling for:\n\n- API failures\n- Network issues\n- Content generation errors\n- Image fetching issues\n- Publishing problems\n\nAll errors are logged to the console with detailed messages.\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nMIT License - see the LICENSE file for details\n\n## Support\n\nFor support, please open an issue in the GitHub repository.\n\n## Acknowledgments\n\n- OpenAI GPT-4o for content generation\n- Ghost for the amazing blogging platform\n- NewsAPI for news sources\n- Unsplash for images\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecryptu%2Fghost-autoblogger-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecryptu%2Fghost-autoblogger-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecryptu%2Fghost-autoblogger-bot/lists"}