Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend service to allow values from http request #548

Closed
azzlack opened this issue Oct 19, 2015 · 5 comments · Fixed by #820
Closed

Extend service to allow values from http request #548

azzlack opened this issue Oct 19, 2015 · 5 comments · Fixed by #820
Labels
service-badge New or updated service badge

Comments

@azzlack
Copy link

azzlack commented Oct 19, 2015

I need to have a badge with values that are only accessible via a http request. (TeamCity build statistics). How about making a form with some input parameters like request url, response type (plain text or json), cache time, response property (if json). The form can then store these settings and generate an url. A request to this generated url will then generate a request to the configured endpoint and the response set as the right side of the badge.

I realize that this might not be a "core" feature, and I'm considering making my own service for this if you do not want that functionality in the core.

@espadrine
Copy link
Member

Just to be sure I understand what you mean, would that work operationally like that?

$ curl http://example.com/something
42
$ xdg-open https://img.shields.io/http/example.com/something.svg?label=something

@azzlack
Copy link
Author

azzlack commented Oct 26, 2015

Yes, that is what I'd like :-)

@espadrine
Copy link
Member

Do you have an example of a URL we can use like that (one that only returns a single number, or something like that), for demonstration and testing purposes?

@paulmelnikow
Copy link
Member

@espadrine http://httpbin.org/ is great for stuff like that!

If I understand correctly #820 implements this.

@paulmelnikow
Copy link
Member

#820 will definitely do that. You can return JSON instead of plain text, and then pick it back out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants