Version 2 (modified by 3 years ago) (diff) | ,
---|
PV277 Programming Applications for Social Robots (autumn 2019)
How to get info from web?
Use API
If API exists, you can usually use JSON data after send the right parameters. Example to get weather data.
import requests url = "http://api.openweathermap.org/data/2.5/weather" params = {'q': 'Brno', 'units': 'metric', 'lang': 'cz'} r = requests.get(url=url, params=params) data = r.json() print(data['main']['temp'])
Attachments (7)
- forecast.py (1.3 KB) - added by 3 years ago.
- news.py (389 bytes) - added by 3 years ago.
- dialoginputs.png (13.1 KB) - added by 2 years ago.
- pepper_connect.png (19.1 KB) - added by 2 years ago.
- pepper_virtual_port.png (14.4 KB) - added by 2 years ago.
- statapp.png (32.0 KB) - added by 2 years ago.
- virustat.zip (5.9 KB) - added by 2 years ago.
Download all attachments as: .zip