Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The flights data is messed up #456

Open
maxrahder opened this issue May 16, 2018 · 3 comments
Open

The flights data is messed up #456

maxrahder opened this issue May 16, 2018 · 3 comments

Comments

@maxrahder
Copy link

Thanks for all the great data feeds!

But the flights data is all mixed up. It looks like you may be extracting your data from an HTML page, which has since been modified and no longer matches your expectations.

Steps to reproduce

Paste this into a browser URL: http://apis.is/flight?language=en&type=departures

You'll see data like this.

{
      "date": "08:40",
      "flightNumber": "<span class=\"cutoff\" title=\"Copenhagen\">Copenhagen</span>",
      "airline": "FI208",
      "to": "<span class=\"cutoff\" title=\"Icelandair\">Icelandair</span>",
      "plannedArrival": "Departed 08:29",
      "realArrival": "\n",
      "status": "\n\t\t\t\t\t\t\t\t"
},{
      "date": "21:10",
      "flightNumber": "<span class=\"cutoff\" title=\"New York JFK\">New York JFK</span>",
      "airline": "WW109",
      "to": "<span class=\"cutoff\" title=\"WOW air\">WOW air</span>",
      "plannedArrival": "",
      "realArrival": "\n<a href=\"#\" data-flight=\"2018/05/16 21:10 GMT+00:00|WW109\" class=\"bt-messenger\" aria-label=\"Notifications to Facebook Messenger\"><i class=\"icon icon-messenger\"></i></a>\n<a href=\"#\" data-flight=\"2018/05/16 21:10 GMT+00:00|WW109\" class=\"bt-twitter\" aria-label=\"Notifications to Twitter\"><i class=\"icon icon-twitter\"></i></a>\n<a href=\"#\" class=\"email-notifications\" aria-label=\"Notifictions by e-mail\"><i class=\"icon icon-mail\"></i></a>\n<a href=\"#\" class=\"pin-flight\" aria-label=\"Pin\"><i class=\"icon icon-pin hidden-sm hidden-md hidden-lg\"></i></a>\n",
      "status": "\n\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"btn btn-rounded btn-blue btn-sm hidden-sm hidden-md pin-flight\"><i class=\"icon icon-planeup\"></i> Pin</a>\n\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"visible-sm visible-md pin-flight\" aria-label=\"Pin\"><i class=\"icon icon-pin\"></i></a>\n\t\t\t\t\t\t\t\t"
}

Just about every field is messed up:

  • date is a time (in local time I assume), rather than a date. This isn't so bad.
  • flightNumber contains HTML, which is bad, and it holds the destination
  • airline appears to be the flight number
  • to contains HTML and holds the airline
  • plannedArrival should probably be named planned, and holds a string description rather than just a date
  • realArrival should probably be named actual arrival, and it sometimes just contains a bunch of HTML
  • status is usually empty, but sometimes just contains a bunch of HTML
@MiniGod
Copy link
Member

MiniGod commented May 16, 2018

Thank you @maxrahder, this is a great reminder. There is already a PR to fix this: #443.

@stale
Copy link

stale bot commented Jul 15, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jul 15, 2018
@ycaK
Copy link

ycaK commented Nov 9, 2018

#474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants