Shields: Badge Request: Spigot badge support

Created on 26 Jul 2020  路  7Comments  路  Source: badges/shields

:clipboard: Description

Support for the Spigot 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)

{
  "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

[
  {
    "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

{
  "id": "1",
  "username": "md_5",
  "resource_count": "12",
  "identities": {
    "twitter": "md__5"
  },
  "avatar": {
    "info": "1545025664",
    "hash": "b53fd878a84d268da2b6456e0b96cae5"
  }
}

Example Badges

| Type | Badge |
| ------------------ | ----------------------------------------------------------------------------------- |
| Version | downloads |
| Price (premium) | downloads |
| Price (Free) | downloads |
| Downloads | downloads |
| Updates | downloads |
| Reviews | downloads |
| Ratings | downloads |
| | downloads |
| | downloads |
| | downloads |
| | downloads |
| | downloads |

: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.

needs-upstream-help service-badge

All 7 comments

Hello @Andre601,

Thanks for pointing this out. XenforoResourceManagerAPI is part of the Spigot API, so in that sense it's an official API unlike the Spiget alternative we're currently using.

Do you know if there are any rate limits involved? Our existing badges return the download size and support server versions for Spigot resources, is this information available through the new API?

Do you know if there are any rate limits involved?

I'm not aware of any.

Our existing badges return the download size and support server versions for Spigot resources, is this information available through the new API?

Sadly not. The API only returns the info I posted above, but it could be suggested on their github.

it could be suggested on their github.

Could you please raise the feature requests? It would be ideal if we could migrate all existing badges to the new official API, rather than having to maintain two separate integrations.

Already did so.

Already did so.

I think we would still be missing the download size!

To be fairly honest here: I really don't expect any answer from Spigot's end as they are - to put it simple - lazy on implementing new feature requests, both in their software and their Forum API.

So I highly doubt that there will be any update on this in the next weeks if not even months.

Having myself worked on Spigot plugins for several years now, I don't know if I would use the word "lazy", but I definitely agree that a lot of feature requests and fixes tend to be implemented very slowly, or never. It's not surprising that the community is quite fragmented and that there have been several Spigot forks over the years.

It probably doesn't hurt to leave this issue around for when/if the new API meets all our requirements, so I suggest we keep our eyes open and hope for the best. :wink:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

paulmelnikow picture paulmelnikow  路  3Comments

PyvesB picture PyvesB  路  3Comments

najeeb-ur-rehman picture najeeb-ur-rehman  路  3Comments

kirankotari picture kirankotari  路  3Comments

salaros picture salaros  路  3Comments