Skip to content

Supporting custom namespaces? #7

Open
@tomcritchlow

Description

@tomcritchlow

Hey there, love what you're doing here Dave to make things simple and easy to use :)

Question - should this parse custom namespaces? For example, I'm playing around with adding structured data for a "books" rss project and made a mockup here:

https://wooden-honorable-kale.glitch.me/feed.xml

So this code:

<item>
<title>Testing new fields</title>
<description>Some description </description>
<pubDate>Thu, 16 Jun 2022 00:00:00 +0000</pubDate>
<books:bookid>https://openlibrary.org/works/OL19098683W</books:bookid>
<link>http://tomcritchlow.com/2022/06/16/rejecting-specialization/</link>
<guid isPermaLink="true">http://tomcritchlow.com/2022/06/16/rejecting-specialization/</guid>
</item>

Get's parsed using reallysimple as:

        {
            "title": "Testing new fields",
            "description": "Some description",
            "pubDate": "2022-06-16T00:00:00.000Z",
            "link": "http://tomcritchlow.com/2022/06/16/rejecting-specialization/",
            "guid": "http://tomcritchlow.com/2022/06/16/rejecting-specialization/"
        }

Ideally I'd like to generate something like this:

        {
            "title": "Testing new fields",
            "description": "Some description",
            "pubDate": "2022-06-16T00:00:00.000Z",
           "books:bookid":"https://openlibrary.org/works/OL19098683W"
            "link": "http://tomcritchlow.com/2022/06/16/rejecting-specialization/",
            "guid": "http://tomcritchlow.com/2022/06/16/rejecting-specialization/"
        }

I'm a bit of a coding beginner (and not sure if I coded the custom namespace correctly?) so forgive me if this doesn't make sense or I'm doing something wrong

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions