Giter Site home page Giter Site logo

ical's Introduction

iCalendar lexer/parser

Go

Golang iCalendar lexer/parser implementing RFC 5545. This project is heavily inspired of the talk Lexical Scanning in Go by Rob Pike.

Usage

import (
    "github.com/luxifer/ical"
)

// filename is an io.Reader
// second parameter is a *time.Location which defaults to system local
calendar, err := ical.Parse(filename, nil)

TODO

  • Implements Missing Properties on VEVENT
  • Implements VTODO
  • Implements VJOURNAL
  • Implements VFREEBUSY
  • Implements VTIMEZONE
  • Implements Missing Components Properties

ical's People

Contributors

jda avatar luxifer avatar minglecm avatar selljamhere avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ical's Issues

Add an encoder

Would you be interested in a patch adding an encoder?

Parser enforces CRLF

Sorry for creating that many issues. I don't expect you to fix them. :P


The parser chokes on inputs which use LF instead of CRLF. While this isn't RFC-compliant (and a formatter should really use CRLF), some existing iCal files in the wild using LF already exist. It would be nice to make the parser more lenient to be able to parse them.

panic: time: missing Location in call to Date

hi,
i got a panic on http://rpayc.com.au/news-events/event-calendar-list?format=raw&type=ical

panic: time: missing Location in call to Date

goroutine 26 [running]:
time.Date(0x7e2, 0x8, 0x16, 0xe, 0x0, 0x0, 0x0, 0x0, 0xc8f1, 0x15, ...)
/opt/go1.10.2/src/time/time.go:1313 +0x659
time.parse(0x6da4da, 0xf, 0xc420238759, 0xf, 0x0, 0x0, 0x4, 0x0, 0x70ce60, 0xc420096e50, ...)
/opt/go1.10.2/src/time/format.go:1094 +0x2ab8
time.ParseInLocation(0x6da4da, 0xf, 0xc420238759, 0xf, 0x0, 0x1, 0xed307259e, 0x854460, 0xc420069320, 0xc420069320)
/opt/go1.10.2/src/time/format.go:783 +0x62
github.com/luxifer/ical.parseDate(0xc4200997d0, 0x854460, 0x6d93a6, 0xb, 0xc4200693b8, 0x0, 0x0)
/home/andreas/go/src/github.com/luxifer/ical/parse.go:523 +0x10e
github.com/luxifer/ical.(*parser).validateEvent(0xc420249980, 0xc4200e02c0, 0xc4201ce000, 0x4)
/home/andreas/go/src/github.com/luxifer/ical/parse.go:426 +0x723
github.com/luxifer/ical.(*parser).scanDelimiter(0xc420249980, 0xf, 0x229, 0xc420238829, 0xa, 0xc4200a6480, 0x4)
/home/andreas/go/src/github.com/luxifer/ical/parse.go:227 +0x76
github.com/luxifer/ical.(*parser).scanContentLine(0xc420249980, 0x0, 0x0)
/home/andreas/go/src/github.com/luxifer/ical/parse.go:276 +0x9b6
github.com/luxifer/ical.(*parser).parse(0xc420249980, 0x25ce, 0xc4200a6440, 0x25ce)
/home/andreas/go/src/github.com/luxifer/ical/parse.go:193 +0xd2
github.com/luxifer/ical.Parse(0x70d320, 0xc42011e5c0, 0x0, 0x4, 0xc4201ee800, 0x26d9)
/home/andreas/go/src/github.com/luxifer/ical/parse.go:85 +0x1f6
main.parse(0xc4201ec000, 0x26db, 0x26db, 0x3e00, 0xc4201ec000, 0x26db, 0x0)
/home/andreas/t/crawler.go:182 +0x131
main.handle(0x688d, 0xc4200200a0, 0x48)
/home/andreas/t/crawler.go:99 +0x47a
main.main.func1()
/home/andreas/t/crawler.go:45 +0x9c
created by main.main
/home/andreas/t/crawler.go:56 +0x19e
exit status 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.