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
# 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": "[email protected]",
"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
$ node app.js
Requesting login page...
Logging in as [email protected]
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
.
Copy and paste your .geojson
data into a service like geojson.io or geojsonlint.com.