Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 10, 2019 15:36
Show Gist options
  • Save vladbatushkov/a98b46a9b21c9376b1b748ef266fe3cd to your computer and use it in GitHub Desktop.
Save vladbatushkov/a98b46a9b21c9376b1b748ef266fe3cd to your computer and use it in GitHub Desktop.
List of Japanese Airlines destinations IATA codes
MERGE (j:Airport { IATA: "HND" })
WITH ("https://en.wikipedia.org/wiki/List_of_Japan_Airlines_destinations") as url, j
CALL apoc.load.html(url, { codes: "table.sortable tr[style!=\"background-color:#ddd\"] td:eq(3)" }) YIELD value
WITH filter(code IN value.codes WHERE code.text <> "HND") as outsideCodes, j
UNWIND outsideCodes as code
MERGE (a:Airport { IATA: code.text })
MERGE (j)-[:TO]->(a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment