gtallen1187 / uber-trip-script

Script that gets your uber Trip Data and exports it as geoJSON

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UberData Trip Script

Note: This code is provided for reference purposes only.

Really quick and dirty script that pulls your trip data from Uber and saves it as GeoJSON. Based on https://github.com/joshhunt/uber

Differences from the source linked above:

  • No more coffeescript
  • Outputs to valid geoJSON FeatureCollection
  • Some bug fixes that had to do with some changes to the Uber page
  • Some bug fixes to skip cancelled trips or other trips that don't have good data

Install

# Clone the source code
$ git clone https://github.com/chriswhong/uber-trip-script.git && cd ./uber-trip-script

# Install NPM dependencies
$ npm install

Create config.json with the following keys:

{
    "username": "your@email.com",
    "password": "yourSecurePassword",
    "tripPages": 3
}

username and password are pretty self explanatory, tripPages is the max number of trips pages you have at https://riders.uber.com/trips

Usage

$ node app.js
Requesting login page...
Logging in as your@email.com
Cool, logged in.
Getting pages [ 1, 2, 3, 4 ]
Fetching https://riders.uber.com/trips?page=1
Fetching https://riders.uber.com/trips?page=2
Fetching https://riders.uber.com/trips?page=3
Fetching https://riders.uber.com/trips?page=4
Fetched all pages, got 4 results

Lots of progress logs are shown, at the end it will generate uberData.geojson.

Mapping

Copy and paste your .geojson data into a service like geojson.io or geojsonlint.com.

geojsonlint screenshot

About

Script that gets your uber Trip Data and exports it as geoJSON


Languages

Language:JavaScript 100.0%