Skip to content

andotis0105/TweetCraft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TweetCraft

TweetCraft is a Python script designed to automate the process of creating and posting enriched tweets. It leverages the OpenAI API to summarize web content and generate related images, then posts these summaries along with the images to Twitter, enhancing user engagement with visually appealing, informative tweets.

TweetCraft is based on Kesha Williams' "Building a Project with the ChatGPT API" LinkedIn Learning course - check out that repository here.

Features

  • Content Summarization: Utilizes OpenAI's GPT model to generate concise summaries of web content.
  • Image Generation: Uses OpenAI's DALL-E to create images that complement the text summaries.
  • Tweet Automation: Automatically posts tweets with text, images, and links to the original content.

Prerequisites

Before you can run TweetCraft, you'll need:

  • Python 3.x
  • OpenAI API key
  • Twitter Developer account and authentication credentials (API key, API secret key, Access token, Access token secret)
  • Installation of the following Python packages: openai, tweepy, python-dotenv, requests.

Installation

Clone the repository:

git clone https://github.com/yourusername/TweetCraft.git

Navigate to the script directory:

cd TweetCraft

Install required Python packages:

pip install -r requirements.txt

Configuration

  1. Create a .env file in the root directory of the project.
  2. Add the following lines to the .env file, replacing placeholders with your actual keys:
    OPENAI_API_KEY='Your_OpenAI_API_Key'
    CONSUMER_KEY='Your_Twitter_Consumer_Key'
    CONSUMER_SECRET='Your_Twitter_Consumer_Secret'
    ACCESS_TOKEN='Your_Twitter_Access_Token'
    ACCESS_TOKEN_SECRET='Your_Twitter_Access_Token_Secret'
    

Usage

To run TweetCraft:

python tweetcraft.py

Follow the prompts to input the URL you want to summarize and tweet.

Contributing

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

Distributed under the MIT License. See LICENSE for more information.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages