arran4 / golang-ical

A ICS / ICal parser and serialiser for Golang.
Apache License 2.0
310 stars 73 forks source link

URL support for parsing (feature) #77

Closed Courtcircuits closed 1 month ago

Courtcircuits commented 1 year ago

I'm working on a project using golang-ical. But the thing is that I need to parse a calendar accessible by a URL. Here is my show-case :

// parse an ical url to instantiate a Calendar
func NewCalendar(url string) Calendar {
    cal, err := ics.ParseCalendar(url)
    return Calendar{
        Url: url,
                Events: cal,
    }
}

The javascript's ical library provides this kind of feature, but I don't want to use javascript to do that. By the way, I can work on this issue. I just wanted to know if it might be helpful for this project to add such a feature (I will fork the project anyway).

arran4 commented 1 year ago

It could be useful for some people depending on how it's done. People might want to provide their own http.Client or http.Request for HTTP auth, rest apis, etc. It would be a bit of work to make it that flexible but happy to consider a PR for some simple implementations. I like util funcs.

Courtcircuits commented 1 year ago

Ok, I will make a PR for the fork that I made then.

arran4 commented 1 year ago

Cool. I will take a look.

arran4 commented 1 month ago

Resolved conflicts in: https://github.com/arran4/golang-ical/pull/102

Please review I will probably try merge it this weekend