Skip to main content

developerWorks >  Information Management  >  Forums  >  IBM Mashup Center  >  developerWorks

Converting RSS to Atom    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is answered.

Permlink Replies: 9 - Pages: 1 - Last Post: Nov 13, 2009 9:50 AM Last Post By: jamest_ibm Threads: [ Previous | Next ]
jamest_ibm

Posts: 52
Registered: Mar 07, 2006 12:35:53 PM
Converting RSS to Atom
Posted: Nov 02, 2009 12:00:50 PM
 
Click to report abuse...   Click to reply to this thread Reply
Ok, this could equally be the other way round and is really about remixing feeds in difference formats from different sources, which is pretty likely with more than one feed! After some experimentation and head scratching I'm coming to the conclusion that it is actually not possible with the InfoSphere Mashup Hub which is hosted on Lotus Greenhouse.

There doesn't seem to be an RSS2Atom operator, nor could I see an option to convert the feed in the source operator, either of which would make the whole thing trivial. There is something about the feed format in the output, but that doesn't seem to do anything much/at all for the entries in a feed. Is it possible to add custom operators to mashup hub?

Without an operator to do the work I had a go at a DIY job using a transformation by creating a simple RSS2Atom feed mashup, which I was hoping to reuse from source operators in other feed mashups. Unfortunately, apart from the reuse thing not really working as expected, there seem to be enough limitations with feed mashups to make the conversion impossible:

How would you handle multiple elements with the same name in the source RSS feed, for example multiple category elements? Even if that was possible, using the category values wouldn't be possible due to the next problem.

This one is more of an issue, since links won't work without it. How do you set the value of an attribute based on the source. I tried dragging it, and it looked like it worked, showing the template value ok... except that it uses the same value for every single entry... there's an unanswered question on developerWorks here -> https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14257899&#14257899

Any help would be great, thanks.
Jean_Anderson

Posts: 199
Registered: Nov 22, 2004 12:08:07 PM
Re: Converting RSS to Atom
Posted: Nov 04, 2009 10:15:03 PM   in response to: jamest_ibm in response to: jamest_ibm's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi, James,

There is no RSS to Atom conversion functionality -- a general request to easily convert between RSS, Atom, and XML has been logged.

Publish only puts the feed header on; it does not convert entries in the feed. The MashupHub User and Administrator Guide [1] says:

"Important: You can change the format type by using the Publish operator. However, the Publish operator only changes the Header of the feed. If a valid feed format is important to you, then ensure that the body of the feed conforms to feed requirements. You can use the Transform operator to convert the elements from one feed type into another feed type."

[1] Can download from http://www-10.lotus.com/ldd/mashupswiki.nsf/dx/IBM_Mashup_Center_1.0_Table_of_Contents

If you want everything in Atom format, then one option is to reformat the entries in the RSS feed using Transform before you merge the feeds. A while ago for somebody else I worked up an example using one of my favorite feeds, which is in RSS format:

http://feeds.feedburner.com/tapestrygetfuzzy

I haven't run this recently, but thought I would post it now anyhow to give you some ideas.

There are lots of ways to produce valid Atom, so this is just one suggestion. I added a Transform operator to reformat the entries, then did the following:

  • Copy the RSS <title> element to the output tree as is.
  • The RSS <link> element needs a corresponding Atom <link> element, but the format is different:
    • Create a new <link> element in the output tree.
    • Right-click on the new <link> element, select New attribute, name it href.
    • Highlight the RSS <link> text and copy it to the href
  • RSS <enclosure> element:
    • Right-click on the new <link> element in the output tree, select New attribute, name it rel.
    • Highlight the RSS <enclosure> url text and copy it to the rel
  • RSS <pubDate> element:
    • Create a new <updated> element in the output tree.
    • Right-click on the new <updated> element,
      • Select Specify a function value.
      • Select Format datetime.
      • In the "Format Type" field, enter "ATOM".
      • In the "Sequence Expression" field, select "Specify a value from the input tree"
      • Highlight the <pubDate> text, then click OK.
  • ATOM <id> element:
    • Create a new <id> element in the output tree.
    • Right-click on the new <id> element,
      • Select Specify a function value.
      • Select Concat.
        • For the first string, enter your url: http://my_url.com/
        • For the second string, select Specify a function value, then select UUID.
  • ATOM <content> element:
    • Create a new <content> element in the output tree.
    • Right-click on the new <content> element, select New attribute, name it type.
    • Right-click type, select edit value, then enter "text".

I ran this mashup, did View source on the result, cut and pasted it into http://validator.w3.org/feed/. In my case, it gave me interoperability recommendations, but I got a "Congratulations! This is a valid Atom 1.0 feed."

I hope this helps a little.

regards,

-jean

Jean_Anderson

Posts: 199
Registered: Nov 22, 2004 12:08:07 PM
Re: Converting RSS to Atom
Posted: Nov 04, 2009 10:30:12 PM   in response to: Jean_Anderson in response to: Jean_Anderson's post
 
Click to report abuse...   Click to reply to this thread Reply
I managed to mangle the format for that post, which looked fine in preview, but the format becomes visible if you hit the reply button.

sorry about that,

-jean
jamest_ibm

Posts: 52
Registered: Mar 07, 2006 12:35:53 PM
Re: Converting RSS to Atom
Posted: Nov 06, 2009 01:24:22 PM   in response to: Jean_Anderson in response to: Jean_Anderson's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi Jean,

Thanks for the reply. That's essentially what I was doing, unfortunately the following step is causing problems...

> {quote:title=Jean_Anderson wrote:}{quote}
> The RSS <link> element needs a corresponding Atom <link> element, but the format is different:
>
> Create a new <link> element in the output tree. > Right-click on the new <link> element, select New attribute, name it href. > Highlight the RSS <link> text and copy it to the href
This initially appeared to work with the mashup hub on Lotus Greenhouse however the same link (the template value) was being put in every item, which is no good. Here's the feed url (http://www.adamgartenberg.com/ is the feed being converted from RSS with the link problems):

https://greenhouse.lotus.com/mashuphub/client/plugin/generate/entryid/7945/pluginid/10

Do you have any other suggestions how to get this working?

Thanks for logging a request for easier conversion.

Regards, James
Jean_Anderson

Posts: 199
Registered: Nov 22, 2004 12:08:07 PM
Re: Converting RSS to Atom
Posted: Nov 07, 2009 12:31:52 PM   in response to: jamest_ibm in response to: jamest_ibm's post
 
Click to report abuse...   Click to reply to this thread Reply
Copying from the other thread on setting attribute values ....:

uh oh, you're right! I didn't realize that copying the text value from a source element to a target attribute broke. I verified last night that a bug was logged and it is fixed in 2.0. But there's no workaround for this in version 1.


sorry to generate false hope on that one!

If you're tracking enhancements, 3022 requests easy conversion between atom, rss and xml. Also, your first post in this thread asked "Is it possible to add custom operators to mashup hub?" The answer is no, but 6766 requests that feature.

regards,

-jean
jamest_ibm

Posts: 52
Registered: Mar 07, 2006 12:35:53 PM
Re: Converting RSS to Atom
Posted: Nov 12, 2009 12:19:04 PM   in response to: Jean_Anderson in response to: Jean_Anderson's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks very much for letting me know the fix is in version 2. Fingers crossed Lotus Greenhouse upgrades when it's released.

Thanks for the enhancement request info as well- is there a site I can track those on? On the subject of requests, and XSLT operator would probably have helped here- are there any plans for something like that as well as custom operators?

Regards, James
Jean_Anderson

Posts: 199
Registered: Nov 22, 2004 12:08:07 PM
Re: Converting RSS to Atom
Posted: Nov 12, 2009 07:26:48 PM   in response to: jamest_ibm in response to: jamest_ibm's post
 
Click to report abuse...   Click to reply to this thread Reply
I'll check on how to track enhancement requests.

I haven't seen any requests for an XSLT operator, but am aware of another development that might interest you. The Mashup Center lets you create your own plugins. For example, this article published back in Aug 2008 helps developers get started:

http://www.ibm.com/developerworks/data/library/techarticle/dm-0808gruber/

Within the next couple months an example will be published on developerWorks that shows how to implement an XSLT plugin. I'll try to remember to post when it goes live. I'd be interested to see how it might help your scenario.

regards,

-jean
Stan

Posts: 432
Registered: Jan 25, 2005 06:45:18 PM
Re: Converting RSS to Atom
Posted: Nov 12, 2009 08:14:10 PM   in response to: jamest_ibm in response to: jamest_ibm's post
 
Click to report abuse...   Click to reply to this thread Reply
Hi Jim -
Jean asked me to respond to your inquiry about tracking requests such as 3022 which she filed on your behalf. Basically, you have to ask. More about that follows if you are interested.

You've hit on an area where there is some disagreement, whether to post request IDs generated outside of standard Technical Support cases. Request (APARs) filed via support can be checked electronically as part of the Support electronic-service system. Being a new product we will file requests that come in via informal and public channels (forums, etc.). I subscribe to the belief that we should give out the reference IDs when we do this even though checking on the request is manual, you need to ask. With a reference ID you can contact Technical Support or post an inquiry back to this forum to get an update. If posted to this forum I will attempt to get an answer. Without a reference ID there is no way to check on a specific request.

HTH
Jean_Anderson

Posts: 199
Registered: Nov 22, 2004 12:08:07 PM
Re: Converting RSS to Atom
Posted: Nov 12, 2009 08:22:56 PM   in response to: Stan in response to: Stan's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks, Stan,

Just one minor correction regarding this:

... your inquiry about tracking requests such as 3022 which she filed on your behalf.


3022 was already in the system (same for 6766).

regards,

-jean
jamest_ibm

Posts: 52
Registered: Mar 07, 2006 12:35:53 PM
Re: Converting RSS to Atom
Posted: Nov 13, 2009 09:50:35 AM   in response to: Jean_Anderson in response to: Jean_Anderson's post
 
Click to report abuse...   Click to reply to this thread Reply
Thanks Jean and Stan, that's all really helpful stuff. The feed source article is especially interesting and looks like it would provide a way to do the RSS to Atom conversion. I look forward to seeing the XSLT article.

I also agree that providing the reference numbers is useful.

Regards, James
 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums