segler-alex / radiobrowser-api

radio browser server api
GNU Affero General Public License v3.0
73 stars 15 forks source link

add examples to documentation #12

Open segler-alex opened 7 years ago

segler-alex commented 7 years ago

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.

TheLastProject commented 7 years ago

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'])