FAA Part-135 Script

I was given a task to collect information on various charter operations in the US that could be used to identify potential partners for a company. Instead of manually clicking though the FAA's website I decided it would be more efficent to scrape the data and reformat the information. Using Phantom JS and a bit of BASH I created a few scripts that does just that!

Below is a snipet of the bash script that iterates though each US state and formats the information to JSON for ease of use later.
 
#! /bin/bash
# one liner to run phantom js script with arguments from states.csv

for i in $( cat states.csv | jq '.[]' ); do

    # Make a dir for each state
    folder=$(echo "STATES/$i" | sed s/\"//g )
    echo $folder
    mkdir -p $folder

    phantomjs get_state_page.js  $( sed -e 's/^"//' -e 's/"$//' <<<"$i")

done 

The majority of the work was done with PhantomJS but it doesn't look pretty to post on here. Check out the Gitub repo if you are intrested in seeing the whole project.

FAA Part 135 Script - on Github