mmcdole / gofeed

Parse RSS, Atom and JSON feeds in Go
MIT License
2.59k stars 208 forks source link

Parsing custom tags in Item #82

Open Nhoya opened 7 years ago

Nhoya commented 7 years ago

Hi, i'm trying to parse this feed https://ctftime.org/event/list/upcoming/rss/ As you can see each item has tags like weight but i can't find a way to parse them, looking at the doc i can't find anything about that

mmcdole commented 7 years ago

Unfortunately, this is considered an invalid feed per the spec:

RSS 2.0 adds that capability, following a simple rule. A RSS feed may contain elements not described on this page, only if those elements are defined in a namespace.

No namespace is specified on these elements. If there was a namespace specified, these items would be present in the feed.Extensions map.

I'm not sure what I could do to to handle these invalid feeds. Perhaps try and dump them into a special entry in the Extensions map, but I'm not sure.

Nhoya commented 7 years ago

In python i can handle this feed using https://github.com/kurtmckee/feedparser maybe you can follow the same idea

mmcdole commented 7 years ago

Let me take a look at what feedparser is doing for this case. Python's dynamic nature may be helping them.

So far, the only thing I can think of is adding these items to a special entry in the extension map.