defunctzombie / badginator

badges for your badges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not counting badges at all on a repo

breakzplatform opened this issue · comments

Hey @defunctzombie,

badginator is only counting himself at my repo: https://github.com/joselitojunior1/slack-list-brazil. the funny thing is that everything was okay two days ago.

this repo has a lot of badges self-hosted, and badginator is actually very useful on this repo, but for some reason its not working anymore. any ideas?

I recently switched to using image analysis to detect badges. Seems that it needs tweaking to properly detect these slack badges. I will take a look at it and see why it isn't working for those badges.

Seems there might be an issue with the SVG returned from the urls in some browsers:

If you visit this url in chrome, I get the pretty colored badge but in safari I get the all black badge you see below.

http://braziljs-slack.herokuapp.com/badge.svg

Not sure why this is the case but it is causing issues for badginator because of how it does the image analysis (expecting there to be two colors). We are using svg2png (which uses phantomjs) to do the svg conversion to png and that is suffering from the same problems as safari is when viewing this badge.

Where are these badges coming from? Maybe the code that generates these badges is not generating good cross browser svg images and we could fix that.

Looking at the slackin repo I see the following commit:

rauchg/slackin@edcaebc

While the commit doesn't say what the issue was, it does alter the svg image output and says fix safari so might be good to try updating your slackin if that is indeed what you are using.

I know this is a PITA to update so many deployments so maybe try one first.

Looking at other slackin issues I see this one from a while back:
rauchg/slackin#55

And it is exactly what is happening. Doesn't say it was fixed but the last time it was an issue was Sept 2015 and the commit above is Nov 2015 so maybe that was the fix.

https://badginator.herokuapp.com/haroenv/holmes.svg also displays 0 while there actually are a whole full 4 badges on https://github.com/haroenv/holmes

@Haroenv the reason it isn't counting correctly for your repo is because the readme is not on the master branch. The logic right now just assumes master branch. Could update it to detect the "default" branch or allow specifying the branch via url.

Default branch would seem useful, and probably just changing a url parameter here https://github.com/defunctzombie/badginator/blob/master/index.js#L173