feeds icon indicating copy to clipboard operation
feeds copied to clipboard

[FEATURE] iTunes RSS extensions support

Open kazhuravlev opened this issue 1 year ago • 0 comments

Is there an existing feature request for this?

  • [X] I have searched the existing feature requests

Is your feature request related to a problem? Please describe.

I would like to generate a RSS feed for iTunes Podcast. This service have a special xml tags. Some of them required, but other - just recommended.

Describe the solution that you would like.

Apple allow to extend some of existing well-known XML tags like channel and item. Itunes tags have a special namespace (prefix for each iTunes tag) like <irunes:....>. So in my opinion we can add some optional field to Channel and Item structs and allow to fill them by user.

It can be looks like this:

feed := &feeds.Feed{
    Title:       "jmoiron.net blog",
    Link:        &feeds.Link{Href: "http://jmoiron.net/blog"},
    Description: "discussion about tech, footie, photos",
    Author:      &feeds.Author{Name: "Jason Moiron", Email: "[email protected]"},
    Created:     now,
    ITunes:      &ItunesFeed{
        Author:     "Author name",
        Type:       "full",
        Image:      "image.png",
        Explicit:   true,
        Categories: []ITunesCategory{...},
    },
    Items: []*feeds.Item{
        &feeds.Item{
            Title:       "Limiting Concurrency in Go",
            Link:        &feeds.Link{Href: "http://jmoiron.net/blog/limiting-concurrency-in-go/"},
            Description: "A discussion on controlled parallelism in golang",
            Author:      &feeds.Author{Name: "Jason Moiron", Email: "[email protected]"},
            Created:     now,
            ITunes:      &ItunesItem{
                {
                    Title: "asdasd",
                    ....
                },
            },
        },
    },
}

This design will allow us to add other RSS extensions from other providers like Spotify, which have their own XML tags.

Links:

Describe alternatives you have considered.

Ability to add a user-defined data in each XML tag like this (it is like a raw access to the rss):


type CustomItem interface {
    // THis methods will allow user to choose - when this custom field will be presented
    MarshalAtom()([]byte,error)
    MarshalRSS()([]byte,error)
    MarshalJSON()([]byte,error)
}


feed := &feeds.Feed{
    Title:       "jmoiron.net blog",
    // ...
}
feed.Add(CustomItemImpl{...})

feed.Items[0].Add(CustomItemImpl{...})

Anything else?

kazhuravlev avatar Jan 14 '24 22:01 kazhuravlev