项目作者: cascandaliato

项目描述 :
Public API to create badges for Exercism.io user profiles.
高级语言: Go
项目地址: git://github.com/cascandaliato/exercism-stats-scraper.git
创建时间: 2020-07-05T14:50:21Z
项目社区:https://github.com/cascandaliato/exercism-stats-scraper

开源协议:MIT License

下载


Superseded by the official Exercism API v3.

Instructions to create a badge are still valid, just replace the data url with https://exercism.org/api/v2/profiles/<user>/solutions (append ?criteria=&track_slug=<language> if you want to filter by programming language), e.g. https://exercism.org/api/v2/profiles/cascandaliato/solutions?criteria=&track_slug=go.


Exercism Stats Scraper · Netlify Exercism statistics

A super simple scraper of Exercism user profiles that can be used to create badges like the one above (instructions here).

  • Right now it retrieves only the number of published solutions from the user profile page https://exercism.io/profiles/<user>.
  • It consists of a single endpoint published at https://exercism-stats-scraper.netlify.app/api/solutions.
  • The endpoint accepts GET requests and requires a user param which must be a valid Exercism user, e.g. https://exercism-stats-scraper.netlify.app/api/solutions?user=casca.
  • It returns a JSON object with the total number of published solutions:
    1. {
    2. "total": number
    3. }
    or, if an error occurred:
    1. {
    2. "error": string
    3. }

Create a Badge

  1. Head to Shields.io.
  2. Fill the form for the Dynamic badge:
    • data type: json
    • data url: https://exercism-stats-scraper.netlify.app/api/solutions?user=<user> (replace <user> with your Exercism user)
    • query: total
    • specify the badge label (e.g. solutions)
  3. Hit the Make Badge button.
  4. Use the resulting image URL to publish your badge.
  5. Optionally, you can add the Exercism logo to your badge by appending &logo=exercism&logoColor=white to the image URL.