Git Product home page Git Product logo

mouse's People

Contributors

mileswwatkins avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jamescarlyle

mouse's Issues

Refactor invocation functions so that they all have the same function signature

Right now, the invocations look like:

handleWeatherInvocation(inReachSlug, days, callback)
handleClosuresInvocation(invocation, callback)
handleWikipediaInvocation(invocation, callback)

As more invocations are added, having some consistency in the function signature would be valuable. Maybe something like handleFoobar(invocation, options, callback)?

Replace "closures" terminology

Because that name isn't inclusive of all the information (updates, warnings, etc).

Maybe with "update" or "notifications" (although the latter is sorta overloaded in UX meaning).

Add e2e tests for error messages

There are plenty of error messages returned due to improper user input; we should confirm that those trigger when we anticipate.

Eg:

  • Error: You must include your InReach location link in your text message
  • Error: You must provide a trail name in your text message, eg mileage pct

Make readme more readable for users

If the README is going to be a product demo, then it needs to read more like user-facing documentation than a REST API spec. Maybe switch from text to screenshots?

Related and part of this task, maybe the dev docs should be moved to a separate document!

Add invocation for "what trail mile am I at?"

Low priority since this is something most hikers will discern via FarOut instead but could be a good convenience tool, and the infrastructure (of determining mileage) could be hooked into other functionality, such as push notifications when closures or notices are nearby the hiker.

Add phone number whitelist

Twilio doesn't allow a blocklist or whitelist for SMS/MMS functionality, so the best we can do is not reply to any phone numbers that aren't on a pre-approved list. This list, for privacy's sake, could be stored on a password-protected AWS S3 bucket, or even just an S3 file that's public but has an unguessable path/URI. Either way, the credentials for acting this list would need to be stored on Twilio Functions as environment variable secrets.

Add invocation for sports scores

This feels like a big quality-of-life feature for users. But it's also a big domain. Probably worth focusing on whichever professional sports have the bulk of their season during North American backpacking months, or perhaps whichever sports have their playoffs during that time.

Also unclear what the cost to serve up this data will be, which is worth investigating on whichever API we use.

Also also, will these scores be live, or just after-the-fact? Will it just be a box score, or will there be any prose attached to it?

Paginate messages that are longer than a single SMS

Some progress and inline documentation already exists in https://github.com/mileswwatkins/Mouse/blob/main/functions/utils.private.js

If a message is longer than the length of an SMS, modern smartphones just handle it like a single MMS. But Garmin InReach will break it up on its servers and send the message as multiple SMSs. Unfortunately, Garmin will break these up at the character level, and they may not be received in the correct order, eg:

oshi Tajiri in 1996, and is centered on fictional creatures called "Pokémon". In Pokémon, humans, known as Pokémon Trainers, catch and train Pokémon to battle o

ther Pokémon for sport. All media works within the franchise are set in the Pokémon universe. The English slogan for the franchise is "Gotta Catch ‘Em All!". Th

Pokémon is a Japanese media franchise managed by The Pokémon Company, a company founded by Nintendo, Game Freak, and Creatures. The franchise was created by Sat

ere are currently 901 Pokémon species.

So, paginating the message (at the word-break level) into several separate SMSs and labeling their order before sending to Garmin is highly desirable, so that even if they're received out of order they are still legible; something like:

(2) Satoshi Tajiri in 1996, and is centered on fictional creatures called "Pokémon". In Pokémon, humans, known as Pokémon Trainers, catch and train Pokémon to

(3) battle other Pokémon for sport. All media works within the franchise are set in the Pokémon universe. The English slogan for the franchise is "Gotta Catch

(1) Pokémon is a Japanese media franchise managed by The Pokémon Company, a company founded by Nintendo, Game Freak, and Creatures. The franchise was created by

(4) ‘Em All!". There are currently 901 Pokémon species.

Set up CI to run unit tests

And run e2e tests whenever pushing to main locally (via Husky) and whenever creating a PR against main (via CI system).

Allow Wikipedia search to handle proper nouns that don't follow first-letter capitalization

Words with internal capitalization (eg, Robert MacNamara) will fail in the Wikipedia search most of the time. It doesn't appear that the Wikipedia/Wikimedia REST API offers a search functionality, but maybe the other Wikipedia/Wikimedia XML/JSON APIs do, in which case we could fall back to that one.

See further explanation for how our current search functionality works inline at https://github.com/mileswwatkins/Mouse/blob/main/functions/wikipedia.private.js#L7-L17

Get more-up-to-date PCTA closures data

It appears that the PCTA website, the only source for closure and hazard notices (not apparently republished on Twitter, etc), now has Cloudflare/hCAPTCHA anti-bot code.

I'm communicating with the PCTA tech lead to see if there's a better/another way to access this data, but for now I'm scraping the Google cache (usually ~24–48 hours old) for this information. A longer term solution could be a daily/hourly AWS Lambda using Puppeteer headless Chrome to try avoiding Cloudflare bot detection, or a paid service to get past the hCAPTCHA. Neither are particularly desirable paths; let's hope that the PCTA has an official solution.

Refactor the AT closures module

There's some DRYing to do, since all three invocation handlers access the same webpage and list items. Not imminently easy, but with some focus there's certainly a good way to simplify this module.

Add push notifications for new closures

High-priority closures could be transmitted to all hikers on a trail, all hikers in a specific state (or who've recently messaged from a neighboring state), or all hikers who are going in that direction (would need to maintain a user database indicating NOBO or SOBO and their most recent check-in)

Add invocation for air quality forecasts

Main blocker is that it's unclear which of the many air quality models are most accurate in the mountains. I tried reaching out to the team leads by phone and email but no luck there.

The New York Times uses HRRR ("Rapid Refresh") in their wildfire/smoke map, but it's unclear whether this is the most accurate model for non-urban areas.

After that, it'll be some work to determine how to get a specific point's air quality value from their KMZ downloads (where each layer is a forecast at a point in time). And this'll probably be too big of a download and too computationally expensive to run every single time it's requested; we'll probably need an AWS Lambda that performs the work once every day (once the model has published) and pre-processes the results for various points along the trail, storing it in a JSON for the Twilio Function to fetch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.