I built a dev.to stats card generator (followers & views count)

Display your Dev.to blog followers count and total post views count in a dynamic card image

Why

I like to share my achievements and having more than 30k views (at the time of writing) on my dev.to blog is a good achievement. Also, I want you to know that my content is helpful and trustworthy, because if it is not then why other people follow me and read my articles!

Dev.to doesn't display followers count or views count so I built a Node.js server that scrapes my followers and views count and renders an SVG image card to display them in a cool way.

Here's an example: refresh if not loaded

If you want to see it get updated follow me or view one of my articles then simply refresh.

How

  1. The Node.js server accepts an HTTP request

  2. It fetches my dashboard using Axios (HTTP Client)

  3. It gets the views and followers count using cheerio (HTML Parser)

  4. It puts the values in an already designed SVG template (by draw.io)

  5. Sends the generated SVG back to the client to display the SVG image

I used SVG because the It is actually some XML code describing how it looks so I can easily embed my values in the text tags without doing heavy image processing.

When I fetch my dashboard I use an authentication cookie which I got from the console and It will be expired next year if I didn't visit dev.to or no one visited a website that displays my stats card so, no need to automate a login workflow.

It is open source so you can fork the repo and deploy your own server from https://github.com/Amr2812/devto-stats-card. You will need to rename .env.sample file to .env and replace the cookie header constant to your own one and in the config.js file you will need to replace the blog URL constant to your own one.

Star the project If you like it ⭐


If you liked the article you can join my newsletter and follow me.