Learning in public via Medium

I usually learn a lot of stuff and keep all the notes to myself. I would like to get into the habit of learning in public so that I can share and help others as well as motivate myself to learn even more! To do so, I will write more posts to Medium. Is there a way to beemind “number of medium articles published”?

2 Likes

I am experimenting with using GitHub - weeping-angel/medium-api: Python Wrapper on top of Unofficial Medium API to quickly extract data from Medium's website. for now, which will allow me to get statistics on my account, a metric I can beemind.

1 Like

Here is my python code I use to create an AWS lambda:

import json
from medium_api import Medium
import os
from dotenv import load_dotenv

load_dotenv()

def lambda_handler(event, context):
        medium = Medium(os.getenv("X_RAPIDAI_API_KEY"))
        user = medium.user(username="devinat11")
        
        # Fetch articles to ensure the articles attribute is populated
        user.fetch_articles()
        
        response = {
                'fullname': user.fullname,
                'followers_count': user.followers_count,
                'articles_count': len(user.articles),
                'articles': [{'title': article.title} for article in user.articles]
        }
        
        return {
                'statusCode': 200,
                'body': json.dumps(response)
        }

I then, through the beeminder api, get the articles_count which I beemind.

2 Likes

There is a relatively easy way to do this! You can join IFTTT and integrate Medium directly to Beeminder with that. I just began tracking this again myself!

2 Likes