Skip to content

Instantly share code, notes, and snippets.

@yuriteixeira
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriteixeira/726975f720e4e5aaf22c to your computer and use it in GitHub Desktop.
Save yuriteixeira/726975f720e4e5aaf22c to your computer and use it in GitHub Desktop.
Generate skyscanner search urls. To open then, copy and paste the result on openlist chrome extension (https://chrome.google.com/webstore/detail/openlist/nkpjembldfckmdchbdiclhfedcngbgnl?hl=en), like you see here: http://i.imgur.com/oCfY2Wy.jpg
<?php
// Usage :
// php fly.php <start_date> <trip_interval> <variance> <from> <to>
//
// Eg: A 7 day trip from VIX to STOC, 30 days of variance
// php fly.php 2015-07-01 30 "+7 day" vix stoc
$start = new \DateTime("{$argv[1]}");
$variance = "+{$argv[2]} day";
$tripInterval = "{$argv[3]}";
$from = "{$argv[4]}";
$to = "{$argv[5]}";
$max = clone $start;
$max->modify($variance);
$template = "http://www.skyscanner.se/transport/flights/%s/%s/%s/%s\n";
while ($start->modify("+1 day")->getTimestamp() <= $max->getTimestamp()) {
$nextDate = clone $start;
$nextDate = $nextDate->modify($tripInterval);
printf($template, $from, $to, $start->format('ymd'), $nextDate->format('ymd'));
}
@camcima
Copy link

camcima commented Jun 24, 2015

Using the Skyscanner Services

In consideration of you agreeing to abide by these Terms, we grant you a non-transferable, non-exclusive licence to download, access and use the Skyscanner Services and/or Skyscanner Platforms for your own personal, non-commercial purposes and for no other purpose. In particular, we grant such licence to you subject to you agreeing that you shall not:

(...)

h) use any automated computer program or application to scan, copy, index, sort or otherwise exploit the Skyscanner Services and/or Skyscanner Platforms or any part thereof.

http://www.skyscanner.net/termsofservice.aspx

@yuriteixeira
Copy link
Author

Where exactly generating skyscanner search urls is going against their terms & conditions? It doesn't do any crawling (scan), and doesn't copy, index or sort anything, since the user is going to see a regular skyscanner page hosted by skyscanner. As far as I understand, I'm creating traffic for skyscanner for free, nothing else.

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