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

feat: Add URL capabilities #1

Merged
merged 1 commit into from
Jun 13, 2023
Merged

feat: Add URL capabilities #1

merged 1 commit into from
Jun 13, 2023

Conversation

beyarkay
Copy link
Contributor

This commit allows the value specified as the first commandline argument to be a URL, in which case it is downloaded (via a blocking reqwest) and parsed into a Calendar struct

I couldn't find many ICS URLs online, but I use them a bunch for my project eskom-calendar, so here are some of those as examples:

╰→ cargo run -- https://github.com/beyarkay/eskom-calendar/releases/download/latest/buffalo-city-block-1.ics
    Finished dev [unoptimized + debuginfo] target(s) in 0.14s
     Running `target/debug/calio 'https://github.com/beyarkay/eskom-calendar/releases/download/latest/buffalo-city-block-1.ics'`

Sun Jun 11 2023
    16:00-18:00 🔌BuffaloCityBlock1 Stage 4 😣
                This event shows that there will be loadshedding on Sunday from 16:00 to Sunday at 18:00 in the load shedding area buffalo-city-block-1.

Mon Jun 12 2023
    21:00-00:00 🔌BuffaloCityBlock1 Stage 3 😟
                This event shows that there will be loadshedding on Monday from 21:00 to Tuesday at 00:00 in the load shedding area buffalo-city-block-1.

Wed Jun 14 2023
    16:00-18:00 🔌BuffaloCityBlock1 Stage 3 😟
                This event shows that there will be loadshedding on Wednesday from 16:00 to Wednesday at 18:00 in the load shedding area buffalo-city-block-1.

    18:00-19:00 ⚠️  End of schedule
                This is the end of the known loadshedding schedule.

This commit allows the value specified as the first commandline argument
to be a URL, in which case it is downloaded (via a blocking reqwest) and
parsed into a Calendar struct:
@oscarmcm oscarmcm self-assigned this Jun 12, 2023
@oscarmcm oscarmcm added the enhancement New feature or request label Jun 12, 2023
@oscarmcm oscarmcm merged commit 03bee10 into oscarmcm:main Jun 13, 2023
@oscarmcm
Copy link
Owner

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants