The idea is build an app that make me consult uber ride prices through my mi band or a smart watch.

Overview

CanIGetHome? - Get uber prices

The main idea is the possibility to me to get the estimate uber rides prices through my mi band 6.

  • Get my current localization
  • Use something to automatize the action with just two clicks (Destination, get prices)
  • Return me through notification all ride price options from uber app
  • Write a quickly resume how to use
  • Publish writing and repository

Well, how the hell you did that?

Firstly, you should know that the mi band 6 don’t make all work, actually my phone and an API made by me do all work.

Ok… Right… The first question that I had when I decided to do this automatization it’s how can I get prices uber from a place to another place. Like, how can I access this info? How can I pass my localization pickup and where I wish drop off? And there I thought about web scraping to do that work. Ok, I’m lying if I told you that was my first thought. Actually I was search about Uber API and I didn’t find anything very clear. So, when I was sad about the idea, I thought made a web scraping.

With a web scraping you can build any application that you want. So I decided to look some requests that a web application from Uber usually do and it was there where I found the sweet route called “graphl”, that made requests sending my pick up localization and my drop off localization with an authentication cookie. Well, if I can do this request from an API that means that I can do what I wish to do. That’s great no?

Follow the images about route

Payload:

image1

Response

image2

Of course that I send some info even that above, like my authentication cookie inside headers but I don’t want to show it for you 🥵 . You know 😏 , I’m dumb but not so.

WELLL. So as you see some values its returned inside an object called fares inside fareEstimates. After made some analysis I discovered that the code attributes inside fares object is a different way to identify Uber rides types. So I discovered that

20022265 = comfort
20027725 = uberx
20034913 = motocycle

And as you can see inside the code object has your related prices:

image3

All right. If I can get this data from my API that means I do the hard work. And I did it and I built an API that have a get prices route receiving two main parameters: pickup coordinates and drop off coordinates. You can read more about the code reading my repository on GitHub.

Repository link: https://github.com/Emerson1337/CanIGetHome

After built the API the next step its to configure my phone to make some requests and generate notifications from this requests. For that I used an app called “MacroDroid” that do all my stuffs on my phone. There I made a macro configured to do all I want to show uber prices through my mi band.

THE MACROGOD

image

Well as you can see my macro do the follow steps:

  • The trigger its when I enable the silent mode from my phone when he is it on my bag (for this case your proximity sensor its near, that means that I’m not with my phone in my hand making the feature useful yet when I want to put silent mode on my phone, because he is it in my hand and not into my bag).
  • When the trigger is fired my macro get my current localization.
  • Make a http request with method GET to my API passing my current localization and drop off localization that I put into a variable inside the app
  • Wait three seconds
  • And make notification that’s showed on my mi band 6.

RESULT

image

Video showing how works. https://youtu.be/y8t5UT-AN6E

That's all, folks 🐷 .

You might also like...

Using a RPI 3b+ to create a PT camera accessible through Windows browser and controllable through MQTT

web-camera_PT A Web flask server converts the MJPEG stream from RPI to JPG img using opencv, then display in browser. Controls added to move Camera in

Dec 20, 2022

Open-source project inspired by the idea of "Long Distance Lamp"

Open-source project inspired by the idea of

Project inspired by the idea of Long Distance Lamp (e.g. Friendship Lamps) for people with no soldering skills.

Mar 19, 2022

It's a repository to studies. Its idea is to learn about Nx and its plugins.

It's a repository to studies. Its idea is to learn about Nx and its plugins.

StudyingNx This project was generated using Nx. 🔎 Smart, Fast and Extensible Build System Adding capabilities to your workspace Nx supports many plug

May 13, 2022

And idea that never worked but was fun while it lasted

THIS IDEA WAS FUN BUT IS DEAD NOW AND SHOULD NOT BE TRUSTED FOR ANYTHING!!! Authsio Core Core authsio web application for identity & access management

Oct 20, 2022

GitHub and Markdown-Based CMS for Blogs. EXPERIMENTAL and in the "Idea" stage. I have no clue if this is feasible.

Turborepo starter This is an official pnpm starter turborepo. What's inside? This turborepo uses pnpm as a package manager. It includes the following

Oct 13, 2022

This app was build to store your activities through the day, using HTML, CSS and JavaScript all working with Webpack.

to-do-list In this project i create a To Do List using webpack. This project allows user to add, remove and mark as complete tasks. Built With HTML CS

May 9, 2022

Web app to search,get, watch animes (built with Nextjs, Tailwind)

Animeinfo An anime discovery, made with NextJs and TailwindCSS. Please deploy your own version of the site, by following the instructions. Please foll

May 24, 2022

👨🏼‍🎨 It is a virtual blackboard, where you can make 🖌 drawings through 🖱 the mouse. You have the option to choose 🎨 colors and line thickness.

👨🏼‍🎨 It is a virtual blackboard, where you can make 🖌 drawings through 🖱 the mouse. You have the option to choose 🎨 colors and line thickness.

👨🏼‍🎨 Lets Draw 🎨 ÍNDICE 1. Lets-Draw 2. Realization of the Project 3. Technologies used 4. Authors 1. Lets-Draw 👨🏼‍🎨 It is a virtual blackboard

Mar 7, 2022

Make friends through music. Discover great sound tracks on Solana and play them with your buddies :dancer:.

Make friends through music. Discover great sound tracks on Solana and play them with your buddies :dancer:.

Acoustic Licious COVID-19 has significantly impacted the mental health of children and adults alike. Globally, the population suffering from lonelines

Oct 28, 2022
Owner
Emerson
Computer Science student && web developer.
Emerson
Mi Band/Amazfit heart rate monitor with OSC integration for VRChat

Mi Band/Amazfit OSC heart rate monitor for VRChat By Vard Based on Jaapp-'s miband-5-heart-rate-monitor and gzalo's miband-6-heart-rate-monitor Thanks

Vard 34 Jan 1, 2023
A Node.js library to calculate Uniswap V3 ratios (prices) from token pairs.

UniV3Prices A Node.js library to calculate Uniswap V3 ratios (prices) and liquidity (reserves). Features This library will allow you to: Calculate pri

Thanos Polychronakis 121 Dec 29, 2022
A prototype snap for injecting gas fee prices into a confirmation window that also serves as the basis for a 5-minute Snaps tutorial

@Montoya/gas-fee-snap A simple Snap example based on @MetaMask/template-snap. Read below for a tutorial! Prerequisites Before you begin, make sure you

Christian Montoya 18 Dec 8, 2022
A continuously updated collection of Tesla superchargers + prices

tesla-superchargers This is a daily updating repo containing a list of all Tesla Superchargers and the current prices for both members (Tesla owners a

Niek van der Maas 15 Dec 21, 2022
Watch anime ad free through a beautiful UI. Don't forget to 🌟 this repo for updates!

Ashanime - Stream Ad-free Anime Ashanime is an Ad free responsive web application built with the intention of providing a pleasent anime streaming exp

Ashanime 67 Dec 31, 2022
Moject is a IoC container and an app factory built around the modules idea of Angular and NestJs.

Moject Moject is an IoC container and an app factory package built around the modules idea of Angular and NestJs. Usage npm install moject Use @Mo

Alexander 4 Dec 4, 2022
In this website you will add books and also watch the lists of books. A website build wit HTML, CSS, and JavaScript.

Awesome Books ES6 In this website you will add books and also watch the lists of books. Built With HTML CSS JavaScript Authors ?? HaaDiiii GitHub: @Ha

Hamid Ali 8 Oct 7, 2022
App that allows you to control and watch YouTube videos using hand gestures. Additionally, app that allows you to search for videos, playlists, and channels.

YouTube Alternative Interaction App An app I made with Edward Wu that allows you to search and watch videos from YouTube. Leverages Google's YouTube D

Aaron Lam 2 Dec 28, 2021
Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines.

Journeys is a django based community-focused website that allows users to bookmark URLs (through chrome extension) and share their journeys through timelines. A timeline is a collection of links that share a common topic or a journey of building and learning something new. Users can create timelines, share them publicly, and explore resources.

Students' Web Committee 14 Jun 13, 2022