Skip to content

monojitb19/langchain-medium-publisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LangChain Medium Auto Publisher

Automate the process of generating and publishing blog posts to Medium using LangChain, OpenAI, and the Medium API — all based on topics scheduled in a simple CSV file.


Features

  • Automated Posting — Publishes the blog scheduled for the current date.
  • LangChain Integration — Uses ChatOpenAI to generate human-like, high-quality content.
  • Image Upload Support — Optionally uploads an image to Medium and embeds it in the post.
  • Customizable Prompt — Fine-tune how AI writes your company blogs.
  • Logging — Tracks each execution in a log file (log.txt).

Project Structure


|
├── main.py # Main automation script
├── blog.csv # CSV file containing topics and product links
├── 1log.txt # Log file with execution history
├── README.md # Documentation
└── requirements.txt


Setup Instructions

1️⃣ Prerequisites


- Python 3.9+
- A valid OpenAI API Key
- A Medium Integration Token
→ Generate from your Medium account settings:
https://medium.com/me/settings


2️⃣ Installation

Clone the repository:

git clone https://github.com/monojitbgit/langchain-medium-publisher.git

Nevigate to the directory

cd langchain-medium-publisher-main

Install required dependencies:

pip install -r requirements.txt

or run

pip install langchain-openai langchain-core requests opencv-python

3️⃣ Configuration

Open medium_post.py and replace placeholders with your credentials:
os.environ["OPENAI_API_KEY"] = "your_openai_api_key_here"
MEDIUM_API_TOKEN = "your_medium_integration_token_here"


5️⃣ Run the Script

Execute the Python script:

python main.py

Technologies Used


LangChain
OpenAI GPT Models
Medium API
Python Libraries: requests, csv, datetime, opencv-python

LangChain OpenAI GPT Models Medium API


License

This project is licensed under the MIT License.
You’re free to use, modify, and distribute it with attribution.

About

Automate Medium blog publishing using LangChain and OpenAI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages