Giter Club home page Giter Club logo

southwest_flight_watcher's Introduction

Southwest Flight Watcher

Introduction

Southwest Price Watcher is an application that constantly searches for Southwest flights that meet certain criteria, emailing the search results when they change. It is useful for monitoring for drops in flight prices.

The application runs locally and requires SMTP email credentials for sending notifications.

Installing and Running

Install

To install, run:

go install github.com/alecholmes/southwest_flight_watcher

Running

To run, arguments with search criteria and email credentials must be passed via command line args.

$GOPATH/bin/southwest_flight_watcher \
  -searchesFile example_searches.json \
  -from [email protected] \
  -smtp smtp.gmail.com \
  -smtpPasswordFile FILE_WITH_YOUR_EMAIL_PASSWORD

This will start the app, using the configuration in the searchesFile (detailed below) to determine which flights to check. It will immediately run a search, then run searches every hour. When the results of a search change, a report will be emailed to the address specified in the -from flag.

To stop the app, hit Ctrl-C.

While the example above uses a GMail account, any email account will work.

Command Line Arguments

-searchesFile

This is the path to a JSON file containing one or more search criteria. An example_searches.json is included in this project.

The file should contain an array of searches.

[
  {
  	// One or more original airport codes.
    "origin_airports": ["SFO", "OAK"],
    
    // One ore more destination airport codes.
    "destination_airports": ["BUR", "LAX", "ONT"],
    
    // The earliest time, inclusive, a flight may depart.
    // The time zone is ignored; the search treats this as
    // the local time at the departure airport.
    // The search will only include flights that leave on this date,
    // regardless of the value of max_arrival_time.
    "min_departure_time": "2016-01-31T17:00:00Z",
    
    // The latest time, inclusive, a flight may arrive.
    // The time zone is ignored; the search treats this as
    // the local time at the arrival airport.
    "max_arrival_time": "2016-01-31T21:00:00Z",
    
    // Optional. The maximum price of the flight in USD cents.
    "max_fare_cents": 7200,
    
    // Optional. The maximum number of stops allowed. 0 is a direct flight.
    "max_number_stops": 0,

    // Optional. Note describing the search, included in the email."
    "note": "Description shown in email"
  }
]

-smtpPasswordFile

A password is required to authenticate with the SMTP server sending email. This argument is the path to a file containing only the password.

The permissions of this file must be 0600 (-rw-------) in order for this file to be used.

Known Issues

This code is poorly tested. There are no unit tests and few ad hoc tests have been run.

License

This project uses the GPLv3 license.

southwest_flight_watcher's People

Contributors

alecholmes avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.