-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcrawl
More file actions
20 lines (17 loc) · 992 Bytes
/
crawl
File metadata and controls
20 lines (17 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/env python
import argparse
from expediacrawler import offersFinder
parser = argparse.ArgumentParser()
parser.add_argument("depart_city", help="The city which you are departing from, 3 letter code")
parser.add_argument("destination_city", help="Destination city, 3 letter code")
parser.add_argument("depart_date", help="Departure date, mm/dd/yyyy")
parser.add_argument("return_date", help="Date of return, mm/dd/yyyy")
parser.add_argument("--add", type=int, help="Search also for flights on these following dates, "
"i.e if departing on 07/15 and -add 2 , then search for 07/16 and 07/17")
parser.add_argument("--file", help="Append the results to this csv file")
args = parser.parse_args()
flex = 0
if args.add:
flex = args.add
offersFinder.find_offers(orig_city=args.depart_city, dest_city=args.destination_city,
leave=args.depart_date, back=args.return_date, forward_days=flex, results_file=args.file)