Skip to content

Instantly share code, notes, and snippets.

@loudambiance
Created April 28, 2020 23:53
Show Gist options
  • Save loudambiance/b7630ab47e1fa3eaf30b6c1511ed567c to your computer and use it in GitHub Desktop.
Save loudambiance/b7630ab47e1fa3eaf30b6c1511ed567c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import urllib.request, json
from sys import argv
if(len(argv) > 1):
with urllib.request.urlopen("https://api.spigotmc.org/simple/0.1/index.php?action=getResource&id="+argv[1]) as url:
data = json.loads(url.read().decode())
print("Downloads: " + data["stats"]["downloads"])
print("Updates: " + data["stats"]["updates"])
print("Reviews: " + data["stats"]["reviews"])
print("Rating: " + data["stats"]["rating"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment