Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.
Yuri Schimke edited this page May 18, 2016 · 17 revisions

Uber

Limitations

Currently only supports public (non user) authentication or manual token authentication.

Authentication

Either use an existing granted token, or visit the Developer Dashboard and select an app.

$ ./oksocial --authorize lyft
Authorising Lyft API
Lyft Client Id: DrXXXXXXX-xxx
Lyft Client Secret:

$ ./oksocial --authorize lyft --token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Queries

$ ./commands/lyftapi '/v1/eta?lat=37.80&lng=-122.45' | jq .
{
  "eta_estimates": [
    {
      "display_name": "Lyft Line",
      "ride_type": "lyft_line",
      "eta_seconds": 120
    },
    {
      "display_name": "Lyft",
      "ride_type": "lyft",
      "eta_seconds": 120
    },
    {
      "display_name": "Lyft Plus",
      "ride_type": "lyft_plus",
      "eta_seconds": 480
    }
  ]
}

Shell Script

#!/usr/bin/env ./okshell

load("classpath:oksocial.js");

var loc = location();

var cost = query("https://api.lyft.com/v1/cost?start_lat=${loc.latitude}&start_lng=${loc.longitude}&end_lat=37.4875929&end_lng=-122.1462192");

cost.cost_estimates.forEach(function(estimate) {
	print(estimate.display_name + " (+" + estimate.primetime_percentage + ") cost " + estimate.estimated_cost_cents_min);
});
Clone this wiki locally