Git Product home page Git Product logo

badged's Introduction


Badged
Badged

Customizable GitHub Release downloads badge service

Downloads Downloads Downloads


A service that provides you with a customizable download count badges for your GitHub Releases. Allows you to keep track of your release downloads and let others know how popular your releases are. Use virtually any badge service (e.g. shields.io) you like! Uses GitHub API, Mongodb ๐ŸŒฑ, Koa โšก and ES17 โœจ. Available for free.

Features

  • Get a shiny downloads badge to add to your projects' README.md
  • Pretty-printed download count
  • Get downloads badge for a specific release by
    • Id
    • Tag
  • Get all-time (total) download count of all your releases
  • Use any badge service of your choice (with any customization offered)
  • Highly scalable service (see Scalability)

Scalability

All downloads are updated at an interval of an hour so as to stay within the GitHub API request limit and increase scalability. Updates are request-driven meaning that download counts are only updated after the interval if the badge is requested. Furthermore, advanced caching is used to ensure only modified data is updated via conditional requests which also reduces API quota usage and increases scalability.

Usage

Using the Badged API is pretty simple, just form the badged link for the desired repo badge and use it as the source of an image element.

HTML

<img src="https://get-badge.herokuapp.com/HR/Crypter" alt="Downloads badge">

Markdown

![Downloads badge](https://get-badge.herokuapp.com/HR/Crypter)

Base url

The base url for all downloads badges is

https://get-badge.herokuapp.com/:username/:repo

Where username and repo are the GitHub username and repository respectively.

Get downloads badge for latest release

https://get-badge.herokuapp.com/:username/:repo

By default, the base url yields a badge for latest release

Get downloads badge for a release by id

https://get-badge.herokuapp.com/:username/:repo/:id

Where id is the GitHub Release id.

Get downloads badge for a release by tag name

https://get-badge.herokuapp.com/:username/:repo/tags/:tag

Where tag is the GitHub Release tag name.

Get downloads badge for all releases

https://get-badge.herokuapp.com/:username/:repo/total

The latest total download count for all releases is calculated when requested.

Specifying a custom badge

By default, the shields.io downloads badge (i.e. https://img.shields.io/badge/downloads-${DOWNLOAD_COUNT}-green.svg) with the calculated download count is sent as the response.

However, you can specify a custom badge URI for any badge via the badge parameter. The badge URI must include the %s substitution character, which badged substitutes with the calculated download count (Pretty-printed), to yield the correct downloads badge. E.g. if the download count is 1293 and the badge URI is https://img.shields.io/badge/downloads-%s-red.svg yields the badge https://img.shields.io/badge/downloads-1,293-red.svg

Examples

  • Downloads badge for the latest release https://get-badge.herokuapp.com/HR/Crypter Crypter
  • Custom downloads badge for the latest release https://get-badge.herokuapp.com/HR/Crypter?badge=https://img.shields.io/badge/downloads-%s-red.svg Crypter
  • Downloads badge for release by id https://get-badge.herokuapp.com/HR/Crypter/5163582 Crypter
  • Downloads badge for release by tag https://get-badge.herokuapp.com/HR/Crypter/tags/v3.0.0 Crypter
  • Downloads badge for all releases https://get-badge.herokuapp.com/HR/Crypter/totalCrypter

License

The MIT License (MIT)

Copyright (c) Habib Rehman (https://git.io/HR)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished todo so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

badged's People

Contributors

hr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

badged's Issues

Make cache more efficient

Make conditional requests for total downloads (pages) and single release download (page) using ETags and only update on receiving a 200 response. This will reduce the GitHub API limited requests quota usage.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.