badginator icon indicating copy to clipboard operation
badginator copied to clipboard

use github api

Open Haroenv opened this issue 8 years ago • 2 comments

The github api returns the README both as url and base64 encoded. I chose to pick the encoded version.

It's also easily possible to add a parameter for any ref now. At line 173 there can be ?ref= which can be whatever we want, branch, tag ... source.

related to https://github.com/defunctzombie/badginator/issues/9#issuecomment-239028851 (but probably actually not fixing that issue)

This also offloads the detection of readme's to github

Haroenv avatar Aug 14 '16 08:08 Haroenv

I just saw it's also possible to directly ask for the raw text or rendered html. Maybe that could be even better? https://developer.github.com/v3/repos/contents/#custom-media-types

Haroenv avatar Aug 14 '16 08:08 Haroenv

Using .set('Accept','application/vnd.github.v3.raw') didn't work properly for me (got back an empty body), while it did work with cURL. Maybe you have more luck trying it out?

Haroenv avatar Aug 14 '16 09:08 Haroenv