An open API service indexing awesome lists of open source software.

https://github.com/shakadak/python-apileekwars

some stuff to use the Leekwars API in python, very basic
https://github.com/shakadak/python-apileekwars

api-wrapper leek-wars python

Last synced: 6 months ago
JSON representation

some stuff to use the Leekwars API in python, very basic

Awesome Lists containing this project

README

          

Incomplete at the moment, you can check @CaptainTheDelta generated implementation here https://gist.github.com/CaptainTheDelta/543f649a97e6009ffa662f15f9f7d7a4

# APILeekwars
some stuff to use the Leekwars API in python, very basic

```Python
import random
import APILeekwars as API

api = API.APILeekwars()
farmer_name = ####
password = ####
r = api.farmer.login_token(farmer_name, password)
if r["success"]:
token = r["token"]
r = api.garden.get_farmer_opponents(token)
if r["success"]:
random.seed()
opponent = random.choice(r["opponents"])["id"]
r = api.garden.start_farmer_fight(opponent, token)
if r["success"]:
print("https://leekwars.com/fight/{}".format(r["fight"]))
r = api.farmer.disconnect(token)
```