Skip to content

Commit

Permalink
Adding cbrf-usd script in JavaScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Pozhidaev committed Feb 13, 2018
1 parent 4410fdb commit 905162f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/cbrf-usd.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var con = org.jsoup.Jsoup.connect("http:https://www.cbr.ru/scripts/XML_daily.asp?date_req=20/01/2018");
var doc = con.get();
var valutes = doc.getElementsByTag("valute");
for(var i = 0;i < valutes.length;i++)
{
var charCode = valutes[i].getElementsByTag("charcode");
if (charCode[0].text() == "USD")
{
var value = valutes[i].getElementsByTag("value");
Luwrain.message(value[0].text());
}
}

0 comments on commit 905162f

Please sign in to comment.