{"id":30223444,"url":"https://github.com/gabrielkoo/devto-stats-github-action","last_synced_at":"2026-04-13T08:31:45.111Z","repository":{"id":307761915,"uuid":"1030630152","full_name":"gabrielkoo/devto-stats-github-action","owner":"gabrielkoo","description":"A GitHub Action that updates your Dev.to articles metrics daily into JSON data and SVG badges.","archived":false,"fork":false,"pushed_at":"2026-04-06T00:20:26.000Z","size":1953,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T02:24:51.860Z","etag":null,"topics":["actions","devto","kiro-ide"],"latest_commit_sha":null,"homepage":"https://gabrielkoo.github.io/devto/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabrielkoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-02T02:00:26.000Z","updated_at":"2026-04-06T00:20:34.000Z","dependencies_parsed_at":"2025-08-02T04:44:16.704Z","dependency_job_id":"586d1f35-1ca9-448d-8261-9c037ca1883b","html_url":"https://github.com/gabrielkoo/devto-stats-github-action","commit_stats":null,"previous_names":["gabrielkoo/devto-stats-github-action"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/gabrielkoo/devto-stats-github-action","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielkoo%2Fdevto-stats-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielkoo%2Fdevto-stats-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielkoo%2Fdevto-stats-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielkoo%2Fdevto-stats-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabrielkoo","download_url":"https://codeload.github.com/gabrielkoo/devto-stats-github-action/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabrielkoo%2Fdevto-stats-github-action/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","devto","kiro-ide"],"created_at":"2025-08-14T12:03:27.076Z","updated_at":"2026-04-13T08:31:45.106Z","avatar_url":"https://github.com/gabrielkoo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📊 dev.to Article Activity Graphs\n\n\u003e 🤖 This entire project was created by [Kiro IDE](https://kiro.dev/) - an AI-powered development environment\n\nGitHub-style contribution graphs for your dev.to article analytics\n\n## 🌐 Live Dashboard\n\n**[gabrielkoo.github.io/devto](https://gabrielkoo.github.io/devto/)** — interactive site with time-range filters, stacked charts, traffic sources, and per-article stats.\n\n\nThis repository fetches your article statistics on dev.to weekly via its v1 API and generates beautiful visualizations of your writing activity.\n\n## 🌐 Traffic Sources Analysis\nShows your top referrers with a beautiful pie chart\n\n![Traffic Sources](graphs/traffic_sources_pie.svg)\n\n## 📈 Views Activity\nShows daily article views with GitHub's classic green color scheme\n\n![Views Graph](graphs/devto_views_graph.svg)\n\n## 💜 Reactions Activity\nShows daily article reactions (likes, unicorns, bookmarks) with purple color scheme\n\n![Reactions Graph](graphs/devto_reactions_graph.svg)\n\n## 🔥 Combined Activity\nShows weighted combined activity (views + comments×5 + reactions×3) with orange color scheme\n\n![Combined Graph](graphs/devto_combined_graph.svg)\n\n## 🏆 Top Articles by Views\nShows your top 3 most viewed articles\n\n![Top Views](graphs/top_3_views.svg)\n\n## ⭐ Top Articles by Reactions\nShows your top 3 most reacted articles\n\n![Top Reactions](graphs/top_3_reactions.svg)\n\n## 🛠 Usage\n\nGenerate custom graphs with different metrics and color schemes:\n\n```bash\n# Activity graphs (GitHub-style contribution graphs)\npython3 generate_advanced_graph.py --metric views --color github\npython3 generate_advanced_graph.py --metric reactions --color purple\npython3 generate_advanced_graph.py --metric comments --color blue\npython3 generate_advanced_graph.py --metric combined --color orange\n\n# Top articles graphs\npython3 generate_top_articles.py --metric views --count 3\npython3 generate_top_articles.py --metric reactions --count 5\n\n# Traffic sources analysis\npython3 generate_traffic_pie_chart.py\npython3 generate_traffic_pie_chart.py --count 15  # Show top 15 instead of 10\n```\n\n**Activity graph options:**\n- `--metric`: views, comments, reactions, combined\n- `--color`: github, blue, purple, orange\n- `--output`: custom filename\n- `--no-stats`: hide statistics\n\n**Top articles options:**\n- `--metric`: views, reactions\n- `--count`: number of top articles to show (default: 3)\n- `--output`: custom filename\n\n**Update data:**\n```bash\npython3 fetch_stats.py\n```\n\n## Data Structure\n\nThe application stores data in the following structure:\n- `./data/articles/{id}-{slug}.json` - Individual article statistics with referrer data\n- `./data/account.json` - Account-wide statistics with aggregated referrer data\n- `./data/top_articles.json` - Top performing articles by metrics\n\nEach article file now includes:\n- Basic metrics: views, comments, reactions\n- Daily breakdown of activity\n- **Referrer data**: domains and their traffic counts\n\n## API Endpoints\n\nThe application uses the following dev.to API endpoints:\n- `/analytics/historical` - Historical analytics data for articles\n- `/analytics/referrers` - Referrer data showing traffic sources\n- `/articles/me/published` - List of published articles\n\n## Procedures\n\n1. List all published articles of the API key's user\n2. For each article,\n   - If it has been processed before (i.e. ./data/articles/{id}-{slug}.json exists), locate the last date in \"breakdown\", use the analytics API to update the `.breakdown` array with new data from the next day.\n   - If it has not been processed before, create a new file with the article's ID and slug, and fetch the analytics data to populate the file. Start from the day when the article was published.\n   - **Fetch referrer data** using the `/analytics/referrers` endpoint to understand traffic sources\n3. Update the `./data/account.json` file with the total statistics and aggregated referrer data of the user.\n\n## Referrer Data\n\nThe application now tracks where your article traffic comes from:\n- **Direct traffic** (domain: null) - users who visited directly\n- **Search engines** - google.com, bing.com, duckduckgo.com\n- **Social media** - linkedin.com, twitter (t.co), facebook.com\n- **Developer platforms** - dev.to, github.com, substack.com\n- **Other sources** - various websites and applications\n\nUse `add_referrers_to_all.py` to add referrer data to existing article files.\n\n## Setup\n\n### Local Setup\n1. Copy `.env.example` to `.env` and add your dev.to API key\n2. Install required dependencies: `pip install requests`\n3. Run `python3 fetch_stats.py` to collect your article data\n4. Generate visualizations with the Python scripts above\n\n### Automated Daily Updates (GitHub Actions)\n\nThis repository includes a GitHub Actions workflow that automatically updates your stats daily.\n\n**Setup:**\n1. Fork this repository\n2. Go to your repository's Settings → Secrets and variables → Actions\n3. Add a new repository secret:\n   - Name: `DEVTO_API_KEY`\n   - Value: Your dev.to API key\n4. The workflow will run daily at midnight UTC and update your graphs\n\n**Features:**\n- Runs daily at midnight UTC to keep your stats current\n- Starts from the 2nd last day to refresh potentially incomplete data\n- Automatically commits and pushes updated graphs\n- Can be manually triggered from the Actions tab\n\n**Manual trigger:**\nGo to Actions → \"Update Dev.to Stats\" → \"Run workflow\" to update immediately.\n\n---\n\n## 🚀 Get Started\n\nReady to create your own dev.to analytics visualizations? Check out the complete source code and documentation:\n\n**[📊 devto-stats-github-action](https://github.com/gabrielkoo/devto-stats-github-action)**\n\nFork the repository, add your dev.to API key, and start generating beautiful GitHub-style contribution grids for your articles!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielkoo%2Fdevto-stats-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabrielkoo%2Fdevto-stats-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabrielkoo%2Fdevto-stats-github-action/lists"}