# Rss feed \<index\> item error

**URL:** <https://www.ruby-forum.com/t/rss-feed-index-item-error/119121>\
**Category:** Ruby\
**Created:** [November 3, 2007, 10:31am UTC](https://www.ruby-forum.com/t/rss-feed-index-item-error/119121 "2007-11-03T10:31:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![baur79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@baur79](https://www.ruby-forum.com/u/baur79)\
**Post date:** [November 3, 2007, 10:31am UTC](https://www.ruby-forum.com/t/rss-feed-index-item-error/119121/1 "2007-11-03T10:31:14Z")

</div>

Hi everybody,  
i’m new in ruby  
here is i get an error.

source code

require ‘rss/2.0’  
require ‘open-uri’  
url = ‘[http://www.nationalbank.kz/rss/rates.xml](http://www.nationalbank.kz/rss/rates.xml)’  
feed = RSS::Parser.parse(open(url).read, false)  
puts “=== Channel: #{feed.channel.title} ===”  
feed.items.each do |item|  
puts item.title  
puts " (#{item.pubDate})"  
puts  
puts item.description  
puts item.index  
end

partial rss feed (you can see all feed following the url = ‘http://  
www.nationalbank.kz/rss/rates.xml’)

EUR 05.11.07 175.11 DOWN

error message:  
auto\_rss.rb:12: undefined method `index' for #<RSS::Rss::Channel::Item: 0x2d3758c> (NoMethodError) from auto_rss.rb:7:in `each’  
from auto\_rss.rb:7

the code goes good if i not out put “puts item.index”,  
but as you see i can’t change the feed  
and i need the value of item.

is there any way to get the value of item

please help me,  
best regards from Kazakhstan / Shymkent city

---

<div class="post-metadata">

**Author:** ![baur79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@baur79](https://www.ruby-forum.com/u/baur79)\
**Post date:** [November 3, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/rss-feed-index-item-error/119121/2 "2007-11-03T13:45:58Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Rss feed item error” on Sat, 3 Nov 2007 18:30:17 +0900,  
baur79 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> but as you see i can’t change the feed  
> and i need the value of item.

What is ? Who does define ?

> is there any way to get the value of item

require ‘rss’  
require ‘open-uri’

module RSS  
class Rss::Channel::Item  
install\_have\_child\_element(“index”, “”, “?”)  
end  
BaseListener.install\_get\_text\_element(“”, “index”, “index”)  
end

url = ‘[http://www.nationalbank.kz/rss/rates.xml](http://www.nationalbank.kz/rss/rates.xml)’  
feed = RSS::Parser.parse(open(url).read, false)  
feed.items.each do |item|  
puts item.index  
end

Thanks,

---

<div class="post-metadata">

**Author:** ![baur79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/22d042/32.png) [@baur79](https://www.ruby-forum.com/u/baur79)\
**Post date:** [November 3, 2007, 8:46pm UTC](https://www.ruby-forum.com/t/rss-feed-index-item-error/119121/3 "2007-11-03T20:46:04Z")

</div>

thanks a lot, for your big help!
