Getting your rides history from Snapp application.
Note: you can see count and price of each bar chart on hover:
You can think of Iranian version of Uber. Their public repository is available in here.
- After installing the extension you need to sign in into your Snapp account.
- When you open https://app.snapp.taxi page a script injects into the HTML
body
. - The script read
access-token
from the page and create a newCustomEvent
withaccess-token
and dispatched bywindow
. - In
contentscript
we listen to the upcoming event message from the injected script. After getting the message, we saveaccess-token
by using chrome.storage API. - Every time you click on MySnapp extension's icon we read
access-token
fromchrome.storage
and then set a state in the mounted React component (popup). - Now we have
access-token
as a state in our component. When you click onLet's Go
button, the App is going request to Snapp API with youraccess-token
- After your data received from Snapp API, we use
chrome.storage
for caching. And for the next time when you click onLet's Go
button, we show your saved data.
All codes executed on the client-side and the extension is only for personal usage. For analyzing the data we need to get your local access-token
from the Snapp PWA. After signing in the token will be saved in chrome storage API. You can remove the extension to destroy your accessToken
completely.
You can get your interactive Heatmap of your rides. Based on Mapbox documentation:
Each Mapbox API has rate limits that cap the number of requests you can make against an endpoint.
So it's better that to get our own access-token
from Mapbox. After register and confirm your email, you can copy your Mapbox access-token
from here and add paste it into the extension.
Pull requests are welcome. We can discuss what you would like to change.
Start: (use dist folder to install on Chrome)
cd my-snapp-extension
npm ci && cd src/popup && npm ci && cd ../..
npm start
Build: (my-snapp-extension.zip)
npm run tada
- #feat update new rides manually/automatically (needs to store the last ride id)
- #feat porting MySnapp to Safari Web Extensions [issue #1]
- #feat porting MySnapp to Firefox Add-ons (maybe we can use it on Android devices)
- add a scroll to bottom button to the pages
- #bug car charts show duplicate data --- resolved in !3