# Feed normalizer and Atom

**URL:** <https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335>\
**Category:** Rails\
**Created:** [September 23, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335 "2008-09-23T20:04:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [September 23, 2008, 8:04pm UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335/1 "2008-09-23T20:04:08Z")

</div>

Hi all -

I can’t find any feed normalizer groups, so I’m trying here. In trying  
to parse an Atom feed with feed normalizer 1.5.1 and Ruby 1.8.7-p72, I  
get this error:

> > feed = FeedNormalizer::FeedNormalizer.parse open(‘[http://www.atomenabled.org/atom.xml](http://www.atomenabled.org/atom.xml)’)  
> > NoMethodError: undefined method `channel' for #<RSS::Atom::Feed: 0x3a4d460> from /usr/local/lib/ruby/gems/1.8/gems/feed-normalizer-1.5.1/ lib/parsers/rss.rb:51:in `package’  
> > from /usr/local/lib/ruby/gems/1.8/gems/feed-normalizer-1.5.1/  
> > lib/parsers/rss.rb:23:in `parse' from /usr/local/lib/ruby/gems/1.8/gems/feed-normalizer-1.5.1/ lib/feed-normalizer.rb:130:in `parse’  
> > from /usr/local/lib/ruby/gems/1.8/gems/feed-normalizer-1.5.1/  
> > lib/feed-normalizer.rb:129:in `each' from /usr/local/lib/ruby/gems/1.8/gems/feed-normalizer-1.5.1/ lib/feed-normalizer.rb:129:in `parse’  
> > from (irb):2

Anyone have any idea what this is about? It’s true that  
RSS:⚛:Feed doesn’t define a ‘channel’ method, and the normalizer  
is trying to call it, but I’m not sure what the path to resolution is.  
Thought maybe someone here might.

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [September 24, 2008, 12:19am UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335/2 "2008-09-24T00:19:03Z")

</div>

Try doing this

FeedNormalizer::FeedNormalizer.parse(xml, :force\_parser =\>  
FeedNormalizer::SimpleRssParser)

This :force\_parser setting will try to avoid calling the method that  
contains this call to `channel’

Dan

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [September 24, 2008, 12:45am UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335/3 "2008-09-24T00:45:25Z")

</div>

I forgot, you might also want to add the :try\_others =\> true option in  
there as well

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [September 24, 2008, 5:49am UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335/4 "2008-09-24T05:49:00Z")

</div>

Thanks so much, Dan. :force\_parser did the trick, and I  
added :try\_others to my parse calls for good measure.

Much appreciated.

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [November 28, 2009, 8:43am UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335/5 "2009-11-28T08:43:38Z")

</div>

Hi Dan…  
Currently working on FeedNormalizer, feed parsing,

Have tried all the things… this code is woking fine to fetch .rss/rss  
feed/other feed types but when I try to fetch atom.xml file…

Like say for eg. fetch any URL like  
“[http://www.atomenabled.org/atom.xml](http://www.atomenabled.org/atom.xml)” with this simple code,  
rss =“[http://www.atomenabled.org/atom.xml](http://www.atomenabled.org/atom.xml)”  
rss = FeedNormalizer::FeedNormalizer.parse (rss, :force\_parser =\>  
FeedNormalizer::SimpleRssParser, :try\_others =\> true)

its giving me this error,

NoMethodError in FeedController#create  
undefined method `channel’ for #RSS::Atom::Feed:0xb6fd9a88

As u have said, this :force\_parser setting try to avoid calling the  
method that  
contains this call to `channel’, I have included in my code but its not  
working at all…

Awaiting for reply,

Thanks in Advance

---

<div class="post-metadata">

**Author:** ![kelleysislander](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kelleysislander](https://www.ruby-forum.com/u/kelleysislander)\
**Post date:** [November 28, 2009, 9:32am UTC](https://www.ruby-forum.com/t/feed-normalizer-and-atom/149335/6 "2009-11-28T09:32:01Z")

</div>

Naresh Rana wrote:

> Hi Dan…  
> Currently working on FeedNormalizer, feed parsing,
> 
> Have tried all the things… this code is woking fine to fetch .rss/rss  
> feed/other feed types but when I try to fetch atom.xml file…
> 
> Like say for eg. fetch any URL like  
> “[http://www.atomenabled.org/atom.xml](http://www.atomenabled.org/atom.xml)” with this simple code,  
> rss =“[http://www.atomenabled.org/atom.xml](http://www.atomenabled.org/atom.xml)”  
> rss = FeedNormalizer::FeedNormalizer.parse (rss, :force\_parser =\>  
> FeedNormalizer::SimpleRssParser, :try\_others =\> true)
> 
> its giving me this error,
> 
> NoMethodError in FeedController#create  
> undefined method `channel’ for #RSS::Atom::Feed:0xb6fd9a88
> 
> As u have said, this :force\_parser setting try to avoid calling the  
> method that  
> contains this call to `channel’, I have included in my code but its not  
> working at all…
> 
> Awaiting for reply,
> 
> Thanks in Advance

======

Done… just have written code something like this,

feed\_url = “[http://www.atomenabled.org/atom.xml](http://www.atomenabled.org/atom.xml)”

rss = FeedNormalizer::FeedNormalizer.parse(open(feed\_url), :force\_parser  
=\> FeedNormalizer::SimpleRssParser)

Its working now…
