autodo-app / autodo

A flexible, intuitive ToDo list app for keeping track of your cars' maintenance needs.
https://autodo-app.herokuapp.com
Other
51 stars 5 forks source link

Pull the oil type and oil filter type from some sort of API #121

Open baylessj opened 4 years ago

baylessj commented 4 years ago

It would be really nice if there was a way to automatically find out what kind/amount of oil the car needed when it reminded you to change the oil.

baylessj commented 3 years ago

https://www.carmd.com/api/vehicle-maintenance-carmd-api/

baylessj commented 3 years ago

Looks like I'm allowed 10 requests per day and then it starts costing a few cents per request from there. I might want to look into a way to cache these results and start hoarding some data to prevent unknown costs from popping up here

baylessj commented 3 years ago

https://www.reddit.com/r/startups/comments/833660/how_to_calculate_pricing_for_a_service_that/

baylessj commented 3 years ago

https://stackoverflow.com/questions/29327386/external-api-call-caching-in-django Related to #384

baylessj commented 3 years ago

So CarMD doesn't actually seem to give any of the info I'm looking for here. Most of the recommended "maintenance" activities are just a visual inspection of various parts. No part number info on any of them, including oil changes.

baylessj commented 3 years ago

Doesn't look like it's possible to do both from the same site. Looking at autozone for the filters and mobil for the oil.

Autozone:

curl -H "user-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0" https://www.autozone.com/ecomm/b2c/v1/ymme/models/2015/Chevrolet/9015009

Mobil:

{
    "parameters": {
        "year": "2021",
        "manufacture": "46",
        "mileage_over_75k": "0",
        "model": "27662",
        "engine": "14779",
        "sub_zero_required": "0",
        "lob": "b2c"
    },
    "callType": "GetRecommendations",
    "isVendorPage": "false",
    "provider": "WMI"
}

Headed to https://www.mobil.com/api/Sitecore/ProductSelector/WmiServices\?sc_lang\=en-US

Fields: "Year", "Make", "Model", "Engine Type", "Over 75,000 mi"
Query: http://www.mobil.com/en/lubricants/what-to-buy/find-the-right-motor-oil/product-recommendations?query=api/v1/en-us/wmi/recommendations/QUERY_STRING"
where QUERY_STRING is formatted as:
2015/47/21517/4749/0/0
or 
YEAR/MAKE/MODEL/ENGINE/unknown/75k?
baylessj commented 3 years ago

Step 1: Use these fields for #371 Step 2: Save both sets of underlying model numbers for mobil and autozone Step 3: Query the APIs to get the oil and oil filter info. Determine where to put this Step 4: Figure out how to display this: put it in the notes automatically?

baylessj commented 3 years ago

At the very least, I need to put a field in todos matching the name "oil" or "oil change" or similar to let the user set the oil type and filter type needed

Or maybe make this a more modular thing where any task can have a list of strings as a "parts needed" field?