https://github.com/knsh14/ical
https://github.com/knsh14/ical
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/knsh14/ical
- Owner: knsh14
- License: mit
- Created: 2020-08-12T14:59:26.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-07-24T18:56:20.000Z (almost 5 years ago)
- Last Synced: 2025-02-04T04:30:12.733Z (over 1 year 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
---
[](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 main
import (
"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)
}
}
}
```