Created
May 7, 2019 16:27
-
-
Save vladbatushkov/c1e0ccd84aca3d043598504d6ebd198a to your computer and use it in GitHub Desktop.
Grab FM frequency of Moscow radio stations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH ("http://www.morze.ru/radio_tv/radio_tv1.htm") as url | |
CALL apoc.load.html(url, { waves: "td.boldtabl"}) YIELD value | |
WITH apoc.coll.pairsMin(value.waves)[0..50] as val | |
UNWIND val as v | |
WITH toFloat(apoc.text.replace(v[0].text, ",", ".")) as fm1, toFloat(apoc.text.replace(v[1].text, ",", ".")) as fm2 | |
WITH apoc.math.round(fm2 - fm1, 1) as diff, fm1, fm2 | |
MERGE (w1:Wave { fm: toString(fm1) + " FM" }) | |
MERGE (w2:Wave { fm: toString(fm2) + " FM" }) | |
MERGE (w1)-[:NEXT { diff: diff }]->(w2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment