Skip to content
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

Supporting custom namespaces? #7

Open
tomcritchlow opened this issue Sep 1, 2022 · 3 comments
Open

Supporting custom namespaces? #7

tomcritchlow opened this issue Sep 1, 2022 · 3 comments

Comments

@tomcritchlow
Copy link

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

@scripting
Copy link
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).

@tomcritchlow
Copy link
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...

@scripting
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants