badges / shields

Concise, consistent, and legible badges in SVG and raster format
https://shields.io
Creative Commons Zero v1.0 Universal
23.76k stars 5.5k forks source link

Add support for bountysource.com #289

Closed lo1tuma closed 10 years ago

lo1tuma commented 10 years ago

It would be awesome if you support bountysoure.com badges.

A badge looks like this: Bountysource

They have an API it is documented here.

espadrine commented 10 years ago

Thanks a lot for the information!

I'll try to implement this next week.

espadrine commented 10 years ago

I am astounded by this API page. Either they stopped supporting it, or it never was, and they published this anyway. The bottom line is that it does not work, and I have no idea how to make it work. The trick isn't to use an Accept: application/json, nor is it to use Accept: application/vnd.bountysource+json (as the RAML definition weirdly suggests).

On the plus side, the badges they provide rely on my own design, which means that the data is embedded in the SVG as text.

lo1tuma commented 10 years ago

You are right, the API doesn’t behave like it’s documented. I‘ve used the chrome developer tools to show me how the actual requests work and was able to do some requests with the header Accept: application/vnd.bountysource+json; version=2.

However, I think it is easier to read the data from the svg.

espadrine commented 10 years ago

Has something changed? Now Mozilla shows no issues, no bounties, nothing.

Thanks for giving me the header that works! Further research showed that they have secret APIs, such as this:

$ curl 'https://api.bountysource.com/teams/mozilla' -H 'Accept: application/vnd.bountysource+json; version=2'
{
  "id": 133,
  "name": "Mozilla",
  "slug": "mozilla",
  "image_url_small": "https://cloudinary-a.akamaihd.net/bountysource/image/upload/d_noaoqqwxegvmulwus0un.png,c_pad,w_100,h_100/e8mqcl3fiikeqgio9lxq.png",
  "image_url_medium": "https://cloudinary-a.akamaihd.net/bountysource/image/upload/d_noaoqqwxegvmulwus0un.png,c_pad,w_200,h_200/e8mqcl3fiikeqgio9lxq.png",
  "image_url_large": "https://cloudinary-a.akamaihd.net/bountysource/image/upload/d_noaoqqwxegvmulwus0un.png,c_pad,w_400,h_400/e8mqcl3fiikeqgio9lxq.png",
  "featured": true,
  "bio": "We're a global community dedicated to making the web better and more open for all. Join us to imagine, build & teach the web's future.",
  "url": "https://www.mozilla.org/",
  "created_at": "2013-09-16T18:08:09.249Z",
  "updated_at": "2014-09-18T20:59:01.060Z",
  "issues_count": 0,
  "updates_count": 0,
  "trackers_count": 5,
  "members_count": 0,
  "backers_count": 1,
  "tagged_count": 3,
  "fundraisers_count": 0,
  "open_bounties_amount": 0,
  "closed_bounties_amount": 0,
  "accepts_public_payins": true,
  "community_can_edit": true
}

I'd prefer working with that than straight up string scraping.

lo1tuma commented 10 years ago

It seems they renamed the team to Mozilla Core

espadrine commented 10 years ago

The bug I filed for the faulty API is on their API documentation website, but its last commit dates back from March.

I'm tempted to scrape the SVG; even their frontend is months old.

espadrine commented 10 years ago

The first thing I can implement according to the developers is team activity.

I'll close this issue with this, more badges will be added as they are implemented by bountysource.