Bot based on ChatGPT that allows automatic publishing of posts about offered products using the Zapier service.
This project is a ChatGPT-based automation bot designed for generating and posting product-related content. It integrates OpenAI's API with Zapier to automate tasks such as fetching product data, generating promotional posts, and publishing them.
-
Product and Image Fetching:
- Automatically retrieves product details and associated images from predefined folders.
- Supports random selection of product and image pairs.
-
Content Generation:
- Leverages OpenAI's API to generate promotional content for products.
- Customizable prompts for tailored content creation.
-
Integration with Zapier:
- Posts generated content, including images, to a Zapier webhook for further automation.
- Supports flexible integration with any platform via Zapier, allowing users to connect with tools like social media, CRMs, and more.
- Requires setting up a Zap on Zapier to handle incoming data and trigger appropriate workflows.
-
Scheduling and Automation:
- Automatically schedules posts at random intervals within a specified range.
- Ensures content is posted only when conditions are met.
Handles file and image retrieval for the products. It fetches data such as title, description, price, and associated image paths.
Integrates with OpenAI's API to generate content based on product data. Implements retry logic for rate-limited requests.
Manages integration with Zapier by sending posts and associated images to a specified webhook URL.
Defines the structure for configuration data, including API keys, folder paths, and webhook URLs.
The main entry point of the application. Orchestrates the overall workflow, including configuration loading, scheduling, and post automation.
Provides utility functions for tasks such as random date generation, configuration reading, and post date management.
-
Clone the Repository:
git clone https://github.com/Z1EMN1AK/ChatGPTBasedSocialBot cd <repository-directory>
-
Configure the Application:
- Create a configuration file named
ProgramConfig.cfg
in the project root. - Populate it with the following structure:
{ "apiKey": "YOUR_OPENAI_API_KEY", "chatGPTModel": "text-davinci-003", "webhookUrl": "YOUR_ZAPIER_WEBHOOK_URL", "dataFolderPath": "./Data", "imageFolderPath": "./Images" }
- Create a configuration file named
-
Prepare Data and Images:
- Place product data files in the
./Data
folder with names likeProduct1.txt
,Product2.txt
, etc. - Place image files in the
./Images
folder with names likeImage1.jpg
,Image2.jpg
, etc.
- Place product data files in the
-
Set Up Zap on Zapier:
- Create a Zap in Zapier to handle incoming data from the webhook.
- Configure the Zap to process and post the content to your desired platform (e.g., Facebook, Twitter, or Slack).
-
Run the Application:
- Build and run the application:
dotnet run
- Follow prompts to specify the configuration file path.
- Build and run the application:
- The bot automatically selects a product and generates a promotional post.
- Posts are scheduled at random intervals based on the
Helpers.GetRandomDate
function. - Generated posts are sent to a Zapier webhook for publishing.
- .NET Core 6.0 or later
- OpenAI API
- Zapier Webhook
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of changes.