I just found this and decided to try it out. It took me a while to make it work since I've never used LUA. Everything is working, but minor changes were needed to get it to run. My code looks like this:
scrape.luaI am getting an error logged:I am loading the JSON file at https://n5dkj.radio/time/webdata.json. The error does not keep the meters from updating correctly.
scrape.lua
Code:
function Initialize()json = dofile( SKIN:GetVariable( '@' )..'json.lua' )scraperData = SKIN:GetMeasure( "WebScraper" )endfunction Update()data = json.decode( scraperData:GetStringValue() )SKIN:Bang( '!SetOption', 'meterSunriseTime', 'Text', 'Sunrise: '..data[ 'sunrise' ] )SKIN:Bang( '!SetOption', 'meterSunSetTime', 'Text', 'Sunset: '..data[ 'sunset' ] )SKIN:Bang( '!SetOption', 'meterPowerballJackpot', 'Text', 'Jackpot: '..data[ 'pbjack' ] )SKIN:Bang( '!SetOption', 'meterPowerballCash', 'Text', 'Cash Value: '..data[ 'pbcash' ] )SKIN:Bang( '!SetOption', 'meterMegaMillionsJackpot', 'Text', 'Jackpot: '..data[ 'mmjack' ] )SKIN:Bang( '!SetOption', 'meterMegaMillionsCash', 'Text', 'Cash Value: '..data[ 'mmcash' ] )end
Code:
Script: json.lua:185: unexpected character '' at line 1 col 1
Statistics: Posted by n5dkj — Yesterday, 2:38 pm — Replies 2 — Views 3551