// Downloading and displaying the best pictures created for
// the legendary computer of the past "ZX-Spectrum"
// from web-site zxart.ee
import "json"
// count of pictures
limit = 60
// display time in seconds
displayTime = 3
// get json
response = http.get(
"http://zxart.ee/api" +
"/types:zxPicture" +
"/export:zxPicture" +
"/language:eng" +
"/start:0" +
"/limit:" + limit +
"/order:votes,desc" +
"/filter:zxPictureMinRating=0;zxPictureType=standard;")
jsonObj = json.parse(response)
pictures = jsonObj["responseData"]["zxPicture"]
for imgData in pictures
// download image
img = http.get(imgData["imageUrl"])
clear
print imgData["title"]
sp = new Sprite
sp.image = img
sp.x = 480
sp.y = 320
sp.scale = 2
display(4).sprites.push sp
wait displayTime
end for