Skip to content

Instantly share code, notes, and snippets.

@ChanceToZoinks
Created May 9, 2022 09:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChanceToZoinks/88cd0edc7b6d71bed07bf3de09718d22 to your computer and use it in GitHub Desktop.
Save ChanceToZoinks/88cd0edc7b6d71bed07bf3de09718d22 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import json
import requests
URL = "https://www.poewiki.net/w/index.php"
PARAMS = {
"title": "Special:CargoExport",
"tables": "items",
"fields": "items.name, items.stat_text",
"where": "rarity='Unique'",
"group by": "items.name",
"order by": "`cargo__items`.`name`",
"limit": 10,
"format": "json",
}
def show_unique_items():
response = requests.get(url=URL, params=PARAMS)
if response.status_code == 200:
print(f"Made request to: {response.url}")
print(json.dumps(response.json()[:2], indent=4))
else:
print(response.reason)
if __name__ == "__main__":
show_unique_items()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment