Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ctaltracker: Add selectable destination and timing offset options #2843

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

danlafeir
Copy link

This PR does two things:

  1. Add two optionally consumed features. Without any change, this app will continue to function as-is for current users
  2. Refactor code structure, naming, caching utility and remove unnecessary API token usage* (You can elect to merge without this commit and the features will be added without issue).

I tested this using pixlet serve, disabled some caching and my own CTA Arrivals API token. Everything worked on my machine... and I believe it will work on yours. I tested each commit individually incase the refactor was not preferable.

I developed this independently but pivoted to this contribution. I wanted the Tidbyt to help with my commute to work. I live a 7 minute walk from the train station, so knowing the next two trains are arriving now and in 2 minutes does not help.

I am happy to independently publish an app if that would be easier or preferable (but there are already three-ish :P)

*I was able to hit https://data.cityofchicago.org/resource/8pix-ypme.json without an app_token so I removed it. It might be required but I was unsure how to locate whether it is required.

Adding a selectable destination enables you to target the trains you
would like to see given a route you want to travel. Personally, I wanted
to see the trains available for my commute to work.

Adding a timing offset enables you to see trains you could catch given
you live X minutes away from the your departure station
@tidbyt
Copy link

tidbyt bot commented Oct 30, 2024

⚠️ The automated review process is experimental and likely has bugs. Please bear with us as we iron out the kinks and enable you to ship changes at high velocity 🚀

Next Steps

Hello! Thank you so much for your change 🤜 🤛 . There are a few things you need to do:

  • Sign the CLA if you haven't already
  • Ensure your build is green! Any problem will display a proposed solution to try out
  • Get a review, either by Tidbyt Bot or by a Tidbyt engineer

Manual Review Required

Hang tight! A Tidbyt engineer will be by shortly to review your change. Here is what they will be looking for:

Test Details
App Dir All files are in a single app directory
🟡 Modules Usage of http.star requires review
🟡 Original Author The original author (samshapiro13) does not match the PR author (danlafeir)

@tidbyt-bot
Copy link

tidbyt-bot commented Oct 30, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@danlafeir
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

@danlafeir
Copy link
Author

recheck

Specifically the following:
- Removed app_code usage from CTA_STATIONS_URL
- Added comments to indicate sections
- Organized function definitions with explicit hoisting
- Move render logic out of CTA Arrivals fetch function
@matslina
Copy link
Contributor

matslina commented Nov 5, 2024

@samshapiro13 Thoughts?

Co-authored-by: Mats Linander <matslina@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants