badges / badges/shields

Badge Request: Spigot badge support

Open
#5,368 7 comments 0 reactions 0 assignees View on GitHub
needs-upstream-help service-badge
Dominant language
JavaScript
Stars
27.2k
Forks
5.6k
Avg merge
1d 8h
Merged PRs (30d)
46

Description

:clipboard: **Description**

Support for the [Spigot XenforoResourceManagerAPI](https://github.com/SpigotMC/XenforoResourceManagerAPI)
Unlike the Spiget API which Shields currently supports does this API allow to retrieve information from premium resources (Such checks are blocked for Spiget making requests either fail or to be outdated).

It current supports to get resource info by id, resource info by author (Array of resources) and get author by id.

**Example response for resource by id**
> Note that all depicted values are always given. Some values (i.e. premium.price and premium.currency) will default to specific values (empty strings or specific text)

```json
{
"id": "2",
"title": "HubKick",
"tag": "Send players to lobby on kick. /lobby / hub",
"current_version": "1.7.1",
"author": {
"id": "106",
"username": "LaxWasHere"
},
"premium": {
"price": "0.00",
"currency": ""
},
"stats": {
"downloads": "6387",
"updates": "22",
"reviews": "9",
"rating": "5"
}
}
```

**Example response for resources by author id**
```json
[
{
"id": "201",
"title": "XenPermissions",
"tag": "Hook your permissions into Xenforo!",
"current_version": "2013-09-28",
"author": {
"id": "1",
"username": "md_5"
},
"premium": {
"price": "0.00",
"currency": ""
},
"stats": {
"downloads": "939",
"updates": "0",
"reviews": "4",
"rating": "4.5"
}
},
{
"id": "342",
"title": "iTag",
"tag": "Performant and Reliable TagAPI Replacement",
"current_version": "22",
"author": {
"id": "1",
"username": "md_5"
},
"premium": {
"price": "0.00",
"currency": ""
},
"stats": {
"downloads": "23573",
"updates": "2",
"reviews": "17",
"rating": "4.41176"
}
}
]
```

**Example response for resource author by id**
```json
{
"id": "1",
"username": "md_5",
"resource_count": "12",
"identities": {
"twitter": "md__5"
},
"avatar": {
"info": "1545025664",
"hash": "b53fd878a84d268da2b6456e0b96cae5"
}
}
```

----
**Example Badges**

| Type | Badge |
| ------------------ | ----------------------------------------------------------------------------------- |
| Version | ![downloads](https://img.shields.io/badge/version-1.0.0-blue) |
| Price (premium) | ![downloads](https://img.shields.io/badge/price-10%20GBP-blue) |
| Price (Free) | ![downloads](https://img.shields.io/badge/price-Free-green) |
| Downloads | ![downloads](https://img.shields.io/badge/downloads-1000-blue) |
| Updates | ![downloads](https://img.shields.io/badge/updates-10-blue) |
| Reviews | ![downloads](https://img.shields.io/badge/reviews-5-blue) |
| Ratings | ![downloads](https://img.shields.io/badge/rating-5-green) |
| | ![downloads](https://img.shields.io/badge/rating-4-yellowgreen) |
| | ![downloads](https://img.shields.io/badge/rating-3-yellow) |
| | ![downloads](https://img.shields.io/badge/rating-2-orange) |
| | ![downloads](https://img.shields.io/badge/rating-1-red) |
| | ![downloads](https://img.shields.io/badge/rating-No%20Ratings-lightgrey) |

:link: **Data**

- **Get resource by ID**: https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id=:id
- **Get resources by author**: https://api.spigotmc.org/simple/0.1/index.php?action=getResourcesByAuthor&id=:id
- **Get author by id**: https://api.spigotmc.org/simple/0.1/index.php?action=getAuthor&id=:id

The API does not require any Auth key or similar. Any normal GET request with a proper User-Agent should be valid.

Documentation: https://github.com/SpigotMC/XenforoResourceManagerAPI

:microphone: **Motivation**

Spigot does no longer allow lookups of premium resources using Robot User-Agents, which Spiget uses according to some.
This has essentially broke the Spiget API for premium resources, making already cached ones only display outdated information and new premium resources not working (Give back an error).

The new dedicated Spigot API allows to request information of Spigot premium resources.

Contributor guide

Open the contributing guide

Research direction

Start with the XenforoResourceManagerAPI documentation and inspect the existing Spiget integration in Shields. Verify the three documented GET endpoints for resources and authors, then check that version, price, downloads, updates, reviews, and ratings badges—including premium-resource lookups—match the examples. Done means the requested badge types work with the documented API responses.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.