npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pimatic-uber

v1.0.0

Published

Get Uber information in the Pimatic dashboard.

Downloads

4

Readme

pimatic-uber

Pimatic module to get Uber ride info into your dashboard.

For now, the module just supports a Price and Time estimate from/to a fixed location you set. This plugin uses the node.js module note-uber to interact with the Uber API.

Using the Plugin

  1. First, install the plugin npm install pimatic-uber
  2. Then you need to register as an Uber Developer.
  3. Once this is done, create a new app, it doesn't matter what you call it (I called mine 'Pimatic Uber'). You need to keep the Client Id, Client Secret and Server Token for the plugin configuration.

Since our app is for private use, we don't need to apply for permission from Uber.

Plugin Configuration

You can load the plugin by editing your config.json to include:

{
  "plugin": "uber",
  "clientId": "YOUR_CLIENT_ID",
  "clientSecret": "YOUR_CLIENT_SECRET",
  "serverToken": "YOUR_SERVER_TOKEN"
}

in the plugins Array.

Device Configuration

Devices can be added by adding them to the devices Array in the config file. Set the class property to UberPriceEstimateDevice

For all device configuration options see the device-config-schema file.

Device examples

Uber Price Estimate Device

For getting your Latitude and Longitude you can use latlong.net.

Start Lat/Long is where you want your starting location to be (for example the location of your home). End Lat/Long is where you want to take the ride to (for example your work location)

sandbox mode sets whether to use the testing or live uber server.

{
  "id": "uber-price-estimate",
  "class": "UberPriceEstimateDevice",
  "name": "Uber Price Estimate",
  "start_longitude": -122.419416,
  "start_latitude": 37.774929,
  "end_longitude": -122.447906,
  "end_latitude": 37.723052,
  "sandbox": true
}

If you want to control which values are displayed, you can use the following:

"showSurge": true,
"showETA": true,
"showPrice": true

Creating a cache file

To work properly, the UberPriceEstimateDevice requires a cache file which includes some information on which Uber Product IDs you want to track. See below for an example of Product IDs from Hong Kong:

{
  "3922df1b-b837-4e95-b8d7-14ec806d1243": {
    "name": "UberBlack",
    "description": "Closest UberBLACK",
    "currency": "HKD"
  },
  "e2300f8d-d24a-420e-afb8-0198c3989236": {
    "name": "UberX",
    "description": "UberX",
    "currency": "HKD"
  }
}

In future this part will be automatic.

TODO

  • Automatically create the cache file from available products
  • Add ability to order a ride from the web interface (how can I do this?)
  • OAuth Client Authorization, how to handle this from our web interface? Additionally we need a web-server for callbacks, how can this fit into pimatic?

Contributing

Feel free to submit any pull requests or add functionality, I'm usually pretty responsive.

If you like the module, please consider donating some bitcoin or litecoin.

Bitcoin

LNzdZksXcCF6qXbuiQpHPQ7LUeHuWa8dDW

LiteCoin

LNzdZksXcCF6qXbuiQpHPQ7LUeHuWa8dDW