@kasharif wrote:
Continuing the discussion from Navigation Screen customization:
Regarding the currency exchange tile tutorial posted by @proeftuin. I have tried, unsucessfully to implement it. Would be thankful if someone could glance over my rules/actions etc. to see if they can identify the problem.
Kept it simple and just using the exact same script as the tutorial at first (once I get that working i'll change the rates).Thanks
Script:
function exchangerates() { var nL = '<linebreak/>'; var base = 'EUR' var symbol1 = 'RON' var symbol2 = 'GBP' var symbol3 = 'HUF' var u = 'http://api.fixer.io/latest?base='+base+'&symbols='+symbol1+','+symbol2+','+symbol3+''; var getrates = web.Download(u); var allrates = JSON.parse(getrates); var currentdate = allrates.date; var rate1 = allrates.rates.RON; var rate2 = allrates.rates.GBP; var rate3 = allrates.rates.HUF; return tag.Size(25,'<b><color Blue>Exchange Rates</color></b>') + nL + tag.Size(20,'<b><color Blue>Date: </color></b>') + '<size 20>'+currentdate+'</size>' + nL + tag.Size(20,'<color White> '+base+' 1 = '+symbol1+' '+rate1+' </color>') + nL + tag.Size(20,'<color White> '+base+' 1 = '+symbol2+' '+rate2+' </color>') + nL + tag.Size(20,'<color White> '+base+' 1 = '+symbol3+' '+rate3+' </color>'); }
Automation command:
End result: The big red box that is blank.
Posts: 2
Participants: 2