https://github.com/morrismorrison/ai-blog
automatically generate and publish blog posts
https://github.com/morrismorrison/ai-blog
chatgpt hashnode python
Last synced: about 1 year ago
JSON representation
automatically generate and publish blog posts
- Host: GitHub
- URL: https://github.com/morrismorrison/ai-blog
- Owner: MorrisMorrison
- Created: 2023-10-31T23:28:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-21T10:03:59.000Z (over 2 years ago)
- Last Synced: 2025-01-24T09:28:01.380Z (over 1 year ago)
- Topics: chatgpt, hashnode, python
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# ai-blog
This Python script leverages ChatGPT to generate blog posts and publishes them to Hashnode.
## Installation
1. Clone the repository:
```bash
git clone https://github.com/MorrisMorrison/ai-blog.git
cd ai-blog
```
2. Install the required dependencies:
`pip install -r requirements.txt`
## Configuration
Before running the script, make sure to set the following environment variables:
- **CHATGPT_API_KEY**: Your ChatGPT API key.
- **HASNODE_API_KEY**: Your Hashnode API key.
- **HASNODE_PUBLICATION_ID**: The Hashnode publication ID - can be retrieved via Hashnode API or from the URL of the publication/blog dashboard.
You can set your prompt in `generate-content-prompt.txt`
## Usage
Run the script with:
- `python3 main.py`
- `python3 main.py --scheduled` - schedules the script.
Scheduling can currently only be configured by manipulating the code
This will prompt the script to generate a blog post using ChatGPT and publish it to Hashnode.
## Contributing
If you'd like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix: git checkout -b feature/my-feature.
- Make your changes and commit them: git commit -m 'Add some feature'.
- Push to the branch: git push origin feature/my-feature.
- Submit a pull request.
## License
This project is licensed under the MIT License - see the LICENSE file for details.