All Projects → chrisenytc → uber-sdk

chrisenytc / uber-sdk

Licence: MIT license
A Ruby SDK for the Uber API

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to uber-sdk

Makisu
Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Stars: ✭ 2,409 (+7428.13%)
Mutual labels:  uber
dailycodingproblem
Solutions to Daily Coding Problem questions
Stars: ✭ 26 (-18.75%)
Mutual labels:  uber
uber
Uber API client
Stars: ✭ 18 (-43.75%)
Mutual labels:  uber
H3
Hexagonal hierarchical geospatial indexing system
Stars: ✭ 3,167 (+9796.88%)
Mutual labels:  uber
ridesharing-ios
Ridesharing driver & rider sample apps using HyperTrack SDK
Stars: ✭ 97 (+203.13%)
Mutual labels:  uber
libretaxi2
Open source Uber PoC #deleteuber
Stars: ✭ 90 (+181.25%)
Mutual labels:  uber
Expo Uber
Uber UI Clone with React Native & Expo
Stars: ✭ 186 (+481.25%)
Mutual labels:  uber
surger
⚡ Is there surge pricing around me right now?
Stars: ✭ 20 (-37.5%)
Mutual labels:  uber
Uber-Like-Cab-Service
Uber Like Android App with PHP backend
Stars: ✭ 123 (+284.38%)
Mutual labels:  uber
makisu
Fast and flexible Docker image building tool, works in unprivileged containerized environments like Mesos and Kubernetes.
Stars: ✭ 2,414 (+7443.75%)
Mutual labels:  uber
Fastlane
🚗 Book Uber from your menubar, fast using Electron, React and Redux 🍟
Stars: ✭ 253 (+690.63%)
Mutual labels:  uber
UberCarAnimation
This app is for animating a car like uber from one position to another with preserving angle and smooth animation
Stars: ✭ 53 (+65.63%)
Mutual labels:  uber
uberscriptquery
UberScriptQuery, a SQL-like DSL to make writing Spark jobs super easy
Stars: ✭ 54 (+68.75%)
Mutual labels:  uber
Uber Mobile Web
This is an attempt to mock the new uber app into mobile web to learn how react can be used to optimize for mobile web.
Stars: ✭ 235 (+634.38%)
Mutual labels:  uber
shared-docs
Shared Markdown Documents from Uber Engineering
Stars: ✭ 12 (-62.5%)
Mutual labels:  uber
Atari Model Zoo
A binary release of trained deep reinforcement learning models trained in the Atari machine learning benchmark, and a software release that enables easy visualization and analysis of models, and comparison across training algorithms.
Stars: ✭ 198 (+518.75%)
Mutual labels:  uber
deck.gl-time-series-widget
A React Time Slider implementation for DECK.GL - (non)temporal data - by CPU filtering ⌛
Stars: ✭ 19 (-40.62%)
Mutual labels:  uber
go-schemaless
An open-source sharded database framework based on Uber's Schemaless
Stars: ✭ 79 (+146.88%)
Mutual labels:  uber
RideShare-Trip-Stats
Chrome Extension to visualize your uber trip statistics
Stars: ✭ 61 (+90.63%)
Mutual labels:  uber
athenadriver
A fully-featured AWS Athena database driver (+ athenareader https://github.com/uber/athenadriver/tree/master/athenareader)
Stars: ✭ 116 (+262.5%)
Mutual labels:  uber

Uber SDK for Ruby

A Ruby SDK for the Uber API

Status

Build Status Maintenance Gem Code Climate Code Climate Gem License Twitter URL

Installation

Add this line to your application's Gemfile:

gem "uber-sdk", require: "uber"

And then execute:

$ bundle

Or install it yourself as:

$ gem install uber-sdk

Configuration

client = Uber::Client.new do |config|
  config.server_token  = "YOUR_SERVER_TOKEN"
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
end

Usage

Request Products

client = Uber::Client.new do |config|
  config.server_token  = "YOUR_SERVER_TOKEN"
end
client.products(latitude: lat, longitude: lon)

Request price estimations

client = Uber::Client.new do |config|
  config.server_token  = "YOUR_SERVER_TOKEN"
end
client.price_estimations(start_latitude: slat, start_longitude: slon,
                         end_latitude: dlat, end_longitude: dlon)

Request time estimations

client = Uber::Client.new do |config|
  config.server_token  = "YOUR_SERVER_TOKEN"
end
client.time_estimations(start_latitude: slat, start_longitude: slon)

Retrieve user info

client = Uber::Client.new do |config|
  config.server_token  = "YOUR_SERVER_TOKEN"
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end
client.me

Retrieve user activities

client = Uber::Client.new do |config|
  config.server_token  = "YOUR_SERVER_TOKEN"
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end
client.history

Request a ride

client = Uber::Client.new do |config|
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end

client.trip_request(product_id: product_id, start_latitude: start_lat, start_longitude: start_lng, end_latitude: end_lat, end_longitude: end_lng)

Simulate a ride request with surge

client = Uber::Client.new do |config|
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end

# Only available in sandbox environment
# Use this to simulate a surge
# More info here https://developer.uber.com/docs/sandbox#section-product-types
client.apply_surge 'product_id', 2.0

client.trip_request(product_id: product_id, start_latitude: start_lat, start_longitude: start_lng, end_latitude: end_lat, end_longitude: end_lng, surge_confirmation_id: surge_id)

Simulate a ride request with no drivers available

client = Uber::Client.new do |config|
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end

# Only available in sandbox environment
# Use this to simulate a request with no drivers available
# More info here https://developer.uber.com/docs/sandbox#section-product-types
client.apply_availability 'product_id', false

client.trip_request(product_id: product_id, start_latitude: start_lat, start_longitude: start_lng, end_latitude: end_lat, end_longitude: end_lng)

Update the status of a ride request

client = Uber::Client.new do |config|
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end

# Only available in sandbox environment
# Use this to simulate the status change of a ride request
# More info here https://developer.uber.com/docs/sandbox#section-request

client.trip_update('request_id', 'accepted')

Retrieve a ride request details

client = Uber::Client.new do |config|
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end

client.trip_details 'request_id'

Cancel a ride request

client = Uber::Client.new do |config|
  config.client_id     = "YOUR_CLIENT_ID"
  config.client_secret = "YOUR_CLIENT_SECRET"
  config.bearer_token  = "USER_ACCESS_TOKEN"
end

client.trip_cancel 'request_id'

Contributing

  1. Fork it ( http://github.com/chrisenytc/uber-sdk/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

License

Check here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].