import system, time, ujson as json, urequests as requests
import uinterface, rgb, wifi

url = 'https://feed2json.org/convert?url=http%3A%2F%2Ffeeds.nos.nl%2Fnosnieuwsalgemeen'
if not uinterface.connect_wifi():
  system.reboot()
 
uinterface.loading_text('Fetching news')
response = requests.get(url)
wifi.disconnect()
rgb.clear()

items = response.json()['items']
titles = [item['title'] for item in items]

for i in range(0,20):
  for title in titles:
	uinterface.skippabletext(title)
	rgb.clear()
	time.sleep(1)
	
system.start('nos')