go-feedparser

Simple RSS and ATOM feed parser

git clone https://git.8pit.net/go-feedparser.git

 1// This program is free software: you can redistribute it and/or modify
 2// it under the terms of the GNU General Public License as published by
 3// the Free Software Foundation, either version 3 of the License, or
 4// (at your option) any later version.
 5//
 6// This program is distributed in the hope that it will be useful,
 7// but WITHOUT ANY WARRANTY; without even the implied warranty of
 8// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 9// GNU General Public License for more details.
10//
11// You should have received a copy of the GNU General Public License
12// along with this program. If not, see <http://www.gnu.org/licenses/>.
13
14/*
15Package feedparser implements a simple RSS and ATOM feed parser.
16
17Tho primary function of interest is the Parse function. You can pass an
18arbitrary Reader to this function and it will return the corresponding
19feed. The following demonstrates and example use case (reading a feed
20from a file):
21
22	file, err := os.Open("feed.xml");
23	if err != nil {
24		panic(err)
25	}
26	defer file.Close()
27
28	feed, err := feedparser.Parse(file);
29	if err != nil {
30		panic(err)
31	}
32
33	switch (feed.Type) {
34	case "rss":
35		fmt.Println("RSS feed!")
36	case "atom":
37		fmt.Println("ATOM feed!")
38	default:
39		fmt.Println("Unknown feed format")
40	}
41*/
42package feedparser