radiobrowser-api icon indicating copy to clipboard operation
radiobrowser-api copied to clipboard

add examples to documentation

Open segler-alex opened this issue 8 years ago • 1 comments

add examples for multiple programming languages to the documentation. java (android), javascript, c# (windows), python,...

also add tutorial, with basic way of using the api, how it is intended to be used.

segler-alex avatar Dec 03 '16 12:12 segler-alex

Here's a simple Python 3 example for getting the names of all idm stations:

import json
from urllib.request import Request, urlopen

request = Request('http://www.radio-browser.info/webservice/json/stations/bytagexact/idm',
                  data=None,
                  headers={'User-Agent': 'YourAppName'})

response = urlopen(request).read().decode('utf-8')
data = json.loads(response)

for station in data:
    print(station['name'])

TheLastProject avatar Dec 03 '16 14:12 TheLastProject