Giter Club home page Giter Club logo

uber-cli's Introduction

Uber CLI

Greenkeeper badge Build Status codecov npm npm

Introduction

Clearly, I'm a lazy person (just look at what this tool does - it helps me figure out if I should order a car to pick me up and drive me to where I want to go).

That being said, as a lazy person it pains me everytime open my phone, open the Uber app, type my destination, and see the estimated price, only for my inner, responsible, cost-cutting, fiduciary-self to end up taking the bus all the way home.

I think we can all agree that it would be much more efficient to simply be disappointed before I open my phone at all.

Install via NPM

npm install uber-cli -g

Usage

Get Time-To-Pickup Estimates

uber time 'pickup address here'

alt_text

Get Price Estimates

uber price -s 'start address' -e 'end address'

alt_text

A Note On Address Identification

So the Uber API identifies time and price estimates based on a coordinate and not an address. In order to support those that don't know their exact coordinates at any given time, I'm using the Google Maps Geocoding API to identify coordinates based on an input address.

uber-cli's People

Contributors

dylanpyle avatar fsargent avatar greenkeeper[bot] avatar greenkeeperio-bot avatar jaebradley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uber-cli's Issues

ReferenceError: Symbol is not defined

var INITIALIZED = Symbol();
                  ^
ReferenceError: Symbol is not defined
    at Object.<anonymous> (/usr/lib/node_modules/uber-cli/node_modules/enumify/lib/enumify.js:14:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/uber-cli/node_modules/uber-client/build/data/Subpath.js:8:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/uber-cli/node_modules/uber-client/build/UberClient.js:22:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/lib/node_modules/uber-cli/node_modules/uber-client/build/index.js:4:19)

Was getting the above error. Fixed by updating nodejs using instructions listed below from this stackoverflow answer.

  1. Clear NPM's cache:
sudo npm cache clean -f
  1. Install a little helper called 'n'
sudo npm install -g n
  1. Install latest stable Node.js version
sudo n stable

Enumify Symbol is not defined

After building from source, and installing requests, I received this error:

/usr/local/lib/node_modules/uber-cli/node_modules/enumify/lib/enumify.js:14
var INITIALIZED = Symbol();
                  ^
ReferenceError: Symbol is not defined
    at Object.<anonymous> (/usr/local/lib/node_modules/uber-cli/node_modules/enumify/lib/enumify.js:14:19)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/uber-cli/node_modules/uber-client/build/data/Subpath.js:8:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/uber-cli/node_modules/uber-client/build/UberClient.js:22:16)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/uber-cli/node_modules/uber-client/build/index.js:4:19)

Appropriate message in price API if distance is more than 100 miles.

uber price -s "konena agrahara" -e "mcafee"

Actual response:

(node:5104) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: StatusCodeError: 422 - {"fields":{"start_longitude":"Distance between two points exceeds 100 miles","e
nd_longitude":"Distance between two points exceeds 100 miles","start_latitude":"Distance between two points exceeds 100 miles","end_latitude":"Distance between two points exceeds 100 miles"},"message":"
Distance between two points exceeds 100 miles","code":"distance_exceeded"}
(node:5104) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.


The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

An in-range update of babel7 is breaking the build 🚨

There have been updates to the babel7 monorepo:

    • The devDependency @babel/cli was updated from 7.6.4 to 7.7.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

This monorepo update includes releases of one or more dependencies which all belong to the babel7 group definition.

babel7 is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Doesn't work in other countries

I am from India and was trying out this library. I tried entering some Indian address, but it seems to pickup random address from other countries.

Request rides

This is a really neat tool. I was hoping I could contribute a feature to request rides as well. But I was little surprised this has not been attempted here yet. So just wanted to check with you @jaebradley whether you think its a good idea or not?

Once you give me the go ahead, I'll start working on this. πŸ‘ Thanks.

Not working

Looks like the API has changed:

{ code: 'unauthorized',
message: 'Invalid OAuth 2.0 credentials provided.' } } }

Dude, fix your fucking code

Where to start?

  • Data objects have Uber-specific implementation details (distance in miles? time in seconds? wtf?!?) Just because Uber defines it like that does not mean your internal interface should.
  • Objects know how they're formatted? Yeah, fuck that. Formatters know how objects are formatted.
  • Tests are brittle as fuck. If they were any more brittle, they'd have fucking osteoporosis. Also, add more unit tests vs. having basically integration tests (which were fine when it was uh less public).

An in-range update of eslint-plugin-import is breaking the build 🚨

The devDependency eslint-plugin-import was updated from 2.16.0 to 2.17.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-import is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 61 commits.

  • 0499050 bump to v2.17.0
  • f479635 [webpack] v0.11.1
  • 8a4226d Merge pull request #1320 from bradzacher/export-ts-namespaces
  • 988e12b fix(export): Support typescript namespaces
  • 70c3679 [docs] make rule names consistent
  • 6ab25ea [Tests] skip a TS test in eslint < 4
  • 405900e [Tests] fix tests from #1319
  • 2098797 [fix] export: false positives for typescript type + value export
  • 70a59fe [fix] Fix overwriting of dynamic import() CallExpression
  • e4850df [ExportMap] fix condition for checking if block comment
  • 918567d [fix] namespace: add check for null ExportMap
  • 2d21c4c Merge pull request #1297 from echenley/ech/fix-isBuiltIn-local-aliases
  • 0ff1c83 [dev deps] lock typescript to ~, since it doesn’t follow semver
  • 40bf40a [*] [deps] update resolve
  • 28dd614 Merge pull request #1304 from bradennapier/feature/typescript-export-type

There are 61 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Headings don't display

Emojis are cool but when you don't have the support then things suck..

No headings display

image

Failed when running from behind a proxy server

I like your CLI. Good job.

But found a minor issue. uber time 'place' - failed when running from behind a proxy server. http_proxy and https_proxy variables were set, before running the command.

Error:

(node:16472) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: connect ECONNREFUSED 216.58.196.106:443

image

price estimates over 100 miles

i see if i do a price estimate over 100 miles, it errors out.

(node:23928) UnhandledPromiseRejectionWarning: Error: StatusCodeError: 422 - {"fields":{"start_longitude":"Distance between two points exceeds 100 miles","end_longitude":"Distance between two points exceeds 100 miles","start_latitude":"Distance between two points exceeds 100 miles","end_latitude":"Distance between two points exceeds 100 miles"},"message":"Distance between two points exceeds 100 miles","code":"distance_exceeded"}

Missing `request` dependency?

node v6.4.0

$ npm install uber-cli -g
/Users/dylan/n/bin/uber -> /Users/dylan/n/lib/node_modules/uber-cli/build/executables/uber.js
/Users/dylan/n/lib
└─┬ [email protected]
  β”œβ”€β”€ @google/[email protected]
  β”œβ”€β”¬ [email protected]
  β”‚ β”œβ”€β”€ [email protected]
  β”‚ └─┬ [email protected]
  β”‚   β”œβ”€β”€ [email protected]
  β”‚   β”œβ”€β”¬ [email protected]
  β”‚   β”‚ └── [email protected]
  β”‚   └─┬ [email protected]
  β”‚     └── [email protected]
  β”œβ”€β”€ [email protected]
  β”œβ”€β”¬ [email protected]
  β”‚ └── [email protected]
  β”œβ”€β”€ [email protected]
  β”œβ”€β”€ [email protected]
  β”œβ”€β”¬ [email protected]
  β”‚ └── [email protected]
  └─┬ [email protected]
    β”œβ”€β”€ [email protected]
    β”œβ”€β”€ [email protected]
    β”œβ”€β”€ UNMET PEER DEPENDENCY request@^2.34
    └─┬ [email protected]
      β”œβ”€β”€ [email protected]
      β”œβ”€β”€ UNMET PEER DEPENDENCY request@^2.34
      β”œβ”€β”¬ [email protected]
      β”‚ └── [email protected]
      └── [email protected]

npm WARN [email protected] requires a peer of request@^2.34 but none was installed.
npm WARN [email protected] requires a peer of request@^2.34 but none was installed.

$ uber time '1234 oak st, sf ca'

###
### The "request" library is not installed automatically anymore.
### But required by "request-promise".
###
### npm install request --save
###

/Users/dylan/n/lib/node_modules/uber-cli/node_modules/request-promise/lib/rp.js:20
    throw err;
    ^

Error: Cannot find module 'request'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at /Users/dylan/n/lib/node_modules/uber-cli/node_modules/request-promise/lib/rp.js:11:16
    at module.exports (/Users/dylan/n/lib/node_modules/uber-cli/node_modules/stealthy-require/lib/index.js:36:23)
    at Object.<anonymous> (/Users/dylan/n/lib/node_modules/uber-cli/node_modules/request-promise/lib/rp.js:10:19)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/dylan/n/lib/node_modules/uber-cli/node_modules/uber-client/build/UberClient.js:10:23)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)

The automated release is failing 🚨

🚨 The automated release from the master branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two-Factor Authentication, make configure the auth-only level is supported. semantic-release cannot publish with the default auth-and-writes level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

'google/maps' is not in the npm registry.

Tried to install it on macOS Sierra, but become this error:

(iMac) / sudo npm install uber-cli -g
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'google/maps' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'uber-cli'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 16.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "uber-cli" "-g"
npm ERR! cwd /
npm ERR! node -v v0.10.32
npm ERR! npm -v 1.4.28
npm ERR! code E404
npm ERR! not ok code 0

Maybe I don't understand something because I haven't got many experience with nodejs earlier.

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.