Skip to content

Commit 213dbfe

Browse files
Add Shields.io badges to readme (#11)
* Add Shields.io badges to readme * Update demo badges * Add default cache value * Add rating to suggested use for CodeChef * Add title to images * Add angle brackets to suggested use
1 parent 7bc7680 commit 213dbfe

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,28 @@ https://competitive-coding-api.herokuapp.com/api/
77
## Request Format
88
https://competitive-coding-api.herokuapp.com/api/{platform_name}/{user_name}
99

10-
### Example
10+
### Example URL
1111
https://competitive-coding-api.herokuapp.com/api/codechef/abhijeet_ar
1212

13+
### Example Badges
14+
[Shields](https://shields.io/) can create dynamically updated badges from a JSON source such as this API. More configuration options are also available in their section on [dynamic badges](https://shields.io/#dynamic-badge).
15+
16+
Replace `<USERNAME>` with your username on that platform.
17+
18+
#### <a href="https://codeforces.com/profile/abhijeet_ar"><img src="https://img.shields.io/badge/dynamic/json?&color=1f8acb&logo=codeforces&label=Codeforces&url=https://competitive-coding-api.herokuapp.com/api/codeforces/abhijeet_ar&query=%24.rating&prefix=Rating%20&style=for-the-badge&cacheSeconds=259200" alt="abhijeet_ar's profile on Codeforces" title="abhijeet_ar's profile on Codeforces"></a>
19+
`https://img.shields.io/badge/dynamic/json?&color=1f8acb&logo=codeforces&label=Codeforces&url=https://competitive-coding-api.herokuapp.com/api/codeforces/<USERNAME>&query=%24.<FIELD>&prefix=<TEXT>&style=for-the-badge&cacheSeconds=86400`
20+
21+
Suggested use,
22+
* `<FIELD>` = `rating`
23+
* `<TEXT>` = `Rating%20`
24+
25+
#### <a href="https://www.codechef.com/users/radix28_numb"><img src="https://img.shields.io/badge/dynamic/json?label=CodeChef&query=%24.country_rank&url=https://competitive-coding-api.herokuapp.com/api/codechef/radix28_numb&prefix=US%20%23&logo=codechef&logoColor=f5f5dc&labelColor=7b5e47&style=for-the-badge&cacheSeconds=259200" alt="radix28_numb's profile on CodeChef" title="radix28_numb's profile on CodeChef"></a>
26+
`https://img.shields.io/badge/dynamic/json?label=CodeChef&query=%24.global_rank&url=https://competitive-coding-api.herokuapp.com/api/codechef/<USERNAME>&prefix=<TEXT>&logo=codechef&logoColor=f5f5dc&labelColor=7b5e47&style=for-the-badge&cacheSeconds=86400`
27+
28+
Suggested use,
29+
* `<FIELD>` = `global_rank`, `country_rank` or `rating`
30+
* `<TEXT>` = `Rank%20`, country abbreviation (e.g., `US%20%23`) or `Rating%20`
31+
1332
### Pro Tip 💡
1433
Use this [JSON Formatter Chrome Extension](https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa?hl=en) to view in a structured format.
1534

0 commit comments

Comments
 (0)