# Reading non-standard/custom attributes in Atom feeds with standard Ruby RSS Library - How?

**URL:** <https://www.ruby-forum.com/t/reading-non-standard-custom-attributes-in-atom-feeds-with-standard-ruby-rss-library-how/143613>\
**Category:** Ruby\
**Created:** [July 21, 2008, 7:52am UTC](https://www.ruby-forum.com/t/reading-non-standard-custom-attributes-in-atom-feeds-with-standard-ruby-rss-library-how/143613 "2008-07-21T07:52:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerald\_b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b2d939/32.png) [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Post date:** [July 21, 2008, 7:52am UTC](https://www.ruby-forum.com/t/reading-non-standard-custom-attributes-in-atom-feeds-with-standard-ruby-rss-library-how/143613/1 "2008-07-21T07:52:42Z")

</div>

Hello,

Using the latest version of the standard web feed library  
(RSS::Parser) [1], that is, 0.2.4, I tried to configure or extend it  
so I can read/access non-standard (custom) feed attributes such as the  
Google Readers’ original-id. Example:

tag:google.com,2005:reader/item/7931b28aaa03e64c

If anyone has tried something similar or has any tips or tricks on  
how to go about I greatly appreciate it. Cheers.

[1] [http://raa.ruby-lang.org/project/rss](http://raa.ruby-lang.org/project/rss)

---

<div class="post-metadata">

**Author:** ![gerald\_b](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b2d939/32.png) [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Post date:** [July 21, 2008, 6:02pm UTC](https://www.ruby-forum.com/t/reading-non-standard-custom-attributes-in-atom-feeds-with-standard-ruby-rss-library-how/143613/2 "2008-07-21T18:02:53Z")

</div>

Hello,

> Using the latest version of the standard web feed library  
> (RSS::Parser) [1], that is, 0.2.4, I tried to configure or extend it  
> so I can read/access non-standard (custom) feed attributes such as the  
> Google Readers’ original-id. Example:
> 
> tag:google.com,2005:reader/item/7931b28aaa03e64c
> 
> If anyone has tried something similar or has any tips or tricks on  
> how to go about I greatly appreciate it.

I’ve got it working. [1] It looks like the standard RSS::Parser  
library cannot handle XML attributes with a dash (such as original-id)  
because it generates Ruby attributes using the XML attribute’s name,  
thus, leading to invalid Ruby identifiers. Using a .gsub(  
‘gr:original-id’, ‘gr:original\_id’ ) on the feed data works around it  
although ideally I rather prefer not to.

Any comments, fixes or alternative workarounds welcome. Cheers.

[1]:  
module RSS  
module Atom

```
class Feed
  class Entry

   class Id < RSS::Element

     install_get_attribute( 'original_id', "", false )

   end

  end
end

```

end  
end
