An embed webservice to display your latest Medium articles on your GitHub README.md
This project generates a dynamic SVG card displaying your three most recent Medium articles, including the title, a generated subtitle, and the publication date. The SVG is designed to be embedded in your GitHub README.md and updates dynamically on each request.
- Dynamic Updates: Always fetches your latest Medium articles.
- Customizable Layout: Displays the title (bold), a generated subtitle (from a blockquote or the first paragraph), and the publication date in a GitHub-dark-themed card.
- Fully Clickable: Each card links directly to the article.
- Optimized for GitHub: Uses only supported SVG elements for proper rendering.
- Easy Hosting: Deployable for free on Render.
- Python 3.7+
- pip
-
Fork the Repository: Instead of cloning directly, it is better practice to fork the repository first. This way, you can push changes to your fork instead of the original project. Visit the repository page and click the "Fork" button in the top-right corner. Then, clone your forked repository:
git clone https://github.com/susapr/medium-github-stats.git cd medium-github-stats -
Install Dependencies:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate pip install -r requirements.txt
Your
requirements.txtshould include:fastapi uvicorn requests feedparser beautifulsoup4
- Update Your Medium Username:
Open the
main.pyfile and locate the following line:ReplaceMEDIUM_RSS_URL = "https://medium.com/feed/@susapr"
@susaprwith your Medium username. For example, if your Medium username isjohndoe, update it as:MEDIUM_RSS_URL = "https://medium.com/feed/@johndoe"
To test the service locally, run:
python main.pyThis starts a FastAPI server (default: http://127.0.0.1:8000). View the card at:
http://127.0.0.1:8000/card
Render provides free hosting for web services. Follow these steps to deploy:
-
Push Your Code to GitHub:
git add . git commit -m "Initial commit" git push origin main
-
Create a Render Account:
- Sign up at Render.com.
- Click "New" > "Web Service".
- Connect your GitHub repo.
-
Configure the Service:
- Name: Choose a name (e.g.,
medium-card). - Region: Select the closest region.
- Branch: Select your main branch.
- Build Command:
pip install -r requirements.txt
- Start Command:
uvicorn main:app --host 0.0.0.0 --port $PORT - Click "Create Web Service".
- Name: Choose a name (e.g.,
-
Verify Deployment: After deployment, Render provides a URL (e.g.,
https://medium-card.onrender.com). Visit:https://medium-card.onrender.com/cardYou should see your Medium articles displayed.
Add this to your README.md to embed the SVG dynamically:
Replace the URL with your Render service URL.
If you found this project helpful, consider giving it a ⭐ on GitHub! Forking and sharing the project is also greatly appreciated. If you use this project in your own work, please give credit by linking back to the original repository!
This project is licensed under the MIT License.
Enjoy showcasing your latest Medium articles on your GitHub profile!