![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
wikipedia-airport-scraper
Advanced tools
Get airport codes and flight connections from Wikipedia airport pages
A small Node.js script to scrape info about airports and their destinations from Wikipedia pages. When provided with the full HTML of any airport page on the mobile version of the English language Wikipedia, it will extract:
It is left to any script that uses this to:
en.m.wikipedia.org
pages, grab responses and rate limit those requests where necessaryRight now, this script doesn't provide any way to look up basic data found on airline pages and as such can't help you to link names to codes. Sunch functionality might be added in the future.
Here's a very simple example that gets data for Brussels Airport from the wikipedia url:
import got from 'got' // Or any other package that requests a HTML page
import write from 'write' // Or any other package that writes data to a local file
import scrape from 'wikipedia-airport-scraper'
// Get the HTML from the page and pass it to the script
const data = await got('https://en.m.wikipedia.org/wiki/Brussels_Airport').then((response) => scrape(response.body))
// Write out the scraped data
const outputPath = new URL('./data.json', import.meta.url).pathname
await write(outputPath, JSON.stringify(data, null, 2))
The data (simplified to show only one airline and one destination) then looks like this:
{
"name": "Brussels Airport",
"iataCode": "BRU",
"icaoCode": "EBBR",
"coordinates": {
"latitude": 50.901389,
"longitude": 4.484444
},
"flights": [
{
"airline": {
"name": "Aegean Airlines",
"link": "Aegean_Airlines"
},
"destination": {
"shortName": "Athens",
"fullName": "Athens International Airport",
"link": "Athens_International_Airport",
"isCharter": false,
"isSeasonal": false,
"suspended": false,
"startDate": null,
"endDate": null
}
}
]
}
It's obvious but probably deserves to be said: the output of this script can only be as good as the Wikipedia page that it uses as input. YMMV.
Two different but related airlines might be mapped to the same link (and ultimately IATA code) by Wikipedia. Here's part of the output from Kansai International Airport that shows All Nippon Airways and ANA Wings with a different name but the same link, in this case serving the same route. For now, the script will not recognise this as a duplicate.
{
"flights": [
{
"airline": {
"name": "All Nippon Airways",
"link": "All_Nippon_Airways"
},
"destination": {
"shortName": "Naha",
"fullName": "Naha Airport",
"link": "Naha_Airport",
"isCharter": false,
"isSeasonal": false,
"suspended": false,
"startDate": null,
"endDate": null
}
},
{
"airline": {
"name": "ANA Wings",
"link": "All_Nippon_Airways"
},
"destination": {
"shortName": "Naha",
"fullName": "Naha Airport",
"link": "Naha_Airport",
"isCharter": false,
"isSeasonal": false,
"suspended": false,
"startDate": null,
"endDate": null
}
}
]
}
null
. Here's part of the output from Ignatyevo Airport that shows Zeya as a destination airport with no Wikipedia page to link to:{
"flights": [
{
"airline": {
"name": "Angara Airlines",
"link": "Angara_Airlines"
},
"destination": {
"shortName": "Zeya",
"fullName": null,
"link": null,
"isCharter": false,
"isSeasonal": true,
"suspended": false,
"startDate": null,
"endDate": null
}
}
]
}
FAQs
Get airport codes and flight connections from Wikipedia airport pages
We found that wikipedia-airport-scraper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.