-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding custom fields? #25
Comments
👍 As I explained in my comment #33 I need to add "wfw" namespace to link comments feeds. I guess that we can find way to extend Feed and Item to be able to add custom entries. I will take a look on what can be done, if there is a pure Go method and if a PR must be proposed. |
My understanding of XML namespaces in Go is that there's some history: golang/go#13400 A 'cheat' way might just to be wrap the output/modify it to add the namespace statically. |
I agree if we only need to add a namespace. But we need to add "tags" in items. The better is to be able to add custom item entries and one or more namespaces on the root element. I didn't checked how to override Item and Feed elements but I think that having the possibility to declare some custom namespaces and item properties should be the way to go. I see something like that: feed := Feed{
// ... append title, author and so on
}
// add a namespace (name, dtd link, feed type that can be RSS, ATOM or ALL)
feed.AddNameSpace("wfw", "http://...", RSS)
item := Item{
Title: "...",
Description: "...",
CustomFields : []CustomFields{
{Name:"wfw", Value:"link to comment field", For: RSS}
},
}
// add item
feed.Items = append(feed.Items, item) What I should do is to:
|
Can we add custom fields to the ITEM ?? |
Can you show an example of what you want to change? The Item aligns with
|
@elithrar Currently the library creates the below ATOM FEED ( Item ) in my case
I want to add custom tags in the Item struct like and The current Item struct allows ->
|
golang/go#13400 seems to be unresolved. On Fri, Oct 21, 2016 at 5:46 AM Patrice Ferlet [email protected]
|
Adds the ability to add custom fields with a namespace to the RSS feed.
This issue has been automatically marked as stale because it hasn't seen a recent update. It'll be automatically closed in a few days. |
I'm creating some custom feeds for my nissan leaf, and, I need to add fields to the rss I generate. The full spec of the tags is here. But, in a nutshell, I just need to add carwings:something tags to the feed. Here's an example -- sorry for the japanese, it's from the url above:
I'm happy to extend gorilla feeds to add the fields, but, I can't figure out an easy way to do it. Thoughts? I'd hate to have to write a new library when yours is so close!
Thanks in advance,
-Dave
The text was updated successfully, but these errors were encountered: