Last active
March 4, 2024 13:26
-
-
Save weeping-angel/9029e637155ebc4038ecc3930af93913 to your computer and use it in GitHub Desktop.
[Get User's Articles] Code to get all the articles written by a Medium User. #python #medium_api #medium_api_py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import libraries | |
import os | |
from medium_api import Medium | |
# Get RAPIDAPI_KEY from the environment | |
api_key = os.getenv('RAPIDAPI_KEY') | |
# Create a `Medium` Object | |
medium = Medium(api_key) | |
# Create an "User" Object using 'username' | |
user = medium.user(username="nishu-jain") | |
# Fetch user-written articles | |
user.fetch_articles() | |
# Iterate over user articles and print their title | |
for article in user.articles: | |
print(article.title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import libraries | |
import os | |
from medium_api import Medium |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get RAPIDAPI_KEY from the environment | |
api_key = os.getenv('RAPIDAPI_KEY') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a `Medium` Object | |
medium = Medium(api_key) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create an "User" Object using 'username' | |
user = medium.user(username="nishu-jain") | |
# Fetch user-written articles | |
user.fetch_articles() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Iterate over user articles and print their title | |
for article in user.articles: | |
print(article.title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
About Me :) — Nishu Jain | |
Medium API — Documentation | |
Added Two New Articles-Related Endpoints! | |
10 Meaningful Ways to Spend Your Evenings Instead of Mindless Scrolling! | |
Why APIs are the Game-Changers of the Startup World 👾 | |
Work/Life Balance Is For Losers | |
Medium API — Frequently Asked Question (FAQs) | |
Medium API and Tokenblogs Join Forces To Revolutionize The NFT Space! 🤝 | |
How “Memes & Funny Videos” are Shaping Our Friendships? | |
Authenticate Medium Users Using Medium API | |
9 Surprising Signs of Emotional Maturity in the Workplace | |
Teacher Forcing — Summary | |
Medium Notification Service | |
How To Get Articles Written By a Medium User Using JavaScript | |
How To Convert Medium Articles In Markdown Format | |
. | |
. | |
. | |
Luck, Quantum entanglement and Psychology | |
You’ll Never Be A Great Writer [Not Your Average Article] | |
4 Tips to Strengthen Your Bonds — Now | |
My Dear Doppelganger … |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment