Skip to content

Supporting custom namespaces? #7

Open

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

Activity

  1. scripting commented on Sep 2, 2022

    @scripting
    Owner

    Hi Tom -- glad you like the reallySimple package and thanks for the support.

    At this time it only understands core elements not namespaces other than the source namespace and some of the standard namespaces people use with RSS/Atom/RDF feeds.

    I don't know if it should or shouldn't understand other namespaces. It was written to provide a good basic feed reading support for a feed reader, ie it understands data that's out there, and not all that it needs to (it's a work in progress).

  2. tomcritchlow commented on Sep 2, 2022

    @tomcritchlow
    Author

    Thanks Dave - yeah I'm not sure if you wanna build out that functionality either (keep it simple!) but I've appreciated using the package and recognize that custom namespaces are an edge case at best...

  3. scripting commented on Sep 2, 2022

    @scripting
    Owner

    @tomcritchlow -- thanks! Here's how I want to approach this. If you find you're absolutely stopped by this missing feature, in a project you're doing (not just thinking about) speak up and we'll see what we can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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