RSS::Parser.parse pubdate changing back

A

Andrew Doades

I have a script that goes into my site and parses the rss feeds, but
when it does this the pub date jumps backup about 11 months.

The code is below,

require 'rss/2.0'
require 'open-uri'
class NewsController < ApplicationController


def index
begin
if !$app_lang || $app_lang == 'en'
feed_url = 'http://www.rediff.com/rss/usrss.xml'
else
feed_url =
'http://localhost:8080/WebSummary/newssummary.jsp?cmbLanguage='+$app_lang
end
open(feed_url) do |http|
response = http.read
@result = RSS::parser.parse(response, false)
logger.info @result.channel.pubDate
end
rescue StandardError => myStandardError
logger.info(myStandardError)
end
end
end

Kind Regards,
Andrew
 
M

melampus

Check your feed and see if you have a "pubDate" (literal) and that the
format is something like "Sat, 07 Sep 2002 00:00:01 GMT"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top