Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/knsh14/ical
https://github.com/knsh14/ical
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/knsh14/ical
- Owner: knsh14
- License: mit
- Created: 2020-08-12T14:59:26.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-07-24T18:56:20.000Z (over 3 years ago)
- Last Synced: 2024-06-20T03:35:38.233Z (5 months ago)
- Language: Go
- Size: 204 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ical
---[![PkgGoDev](https://pkg.go.dev/badge/github.com/knsh14/ical)](https://pkg.go.dev/github.com/knsh14/ical)
parse iCal file based on [RFC 5545]( https://tools.ietf.org/html/rfc5545 )
# Example
https://play.golang.org/p/SDQl0Cwc67J
```go
package mainimport (
"fmt"
"log"
"net/http""github.com/knsh14/ical"
"github.com/knsh14/ical/parser"
)func main() {
res, err := http.Get("https://www.google.com/calendar/ical/japanese__ja%40holiday.calendar.google.com/public/basic.ics")
if err != nil {
log.Fatal(err)
}
cal, err := parser.Parse(res.Body)
if err != nil {
log.Fatal(err)
}
for _, c := range cal.Components {
if e, ok := c.(*ical.Event); ok {
fmt.Println(e.Summary.Value)
}
}
}
```