stringer-rss / stringer

A self-hosted, anti-social RSS reader.
MIT License
3.94k stars 395 forks source link

FZ.se feed not working #385

Closed kaksmet closed 9 years ago

kaksmet commented 9 years ago

The feed http://www.fz.se/core/rss/fznews_rss20.xml does not work in stringer. It does however work in a few other feed readers I have tested.

I am running the latest commit of stringer. In the stringer UI it has the red dot next to it, with the text "Error parsing (and it ain't never worked before either)".

The log contains this: /usr/local/bundle/gems/feedjira-1.3.0/lib/feedjira/feed.rb:237: warning: uncaught exception from callback

The feed itself does contains some errors (https://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fwww.fz.se%2Fcore%2Frss%2Ffznews_rss20.xml)

Is this something related to stringer itself or should it be reported to feedjira? Or even the maintainer of the feed?

swanson commented 9 years ago

It's most likely a problem in feedjira or just a malformed feed in general.

kaksmet commented 9 years ago

It doesn't appear to be a problem in feedjira.

Using irb to fetch and parse the feed with feedjira gives the expected result.

irb(main):001:0> require "feedjira"
=> true
irb(main):002:0> Feedjira::VERSION
=> "1.3.0"
irb(main):003:0> url = "http://www.fz.se/core/rss/fznews_rss20.xml"
=> "http://www.fz.se/core/rss/fznews_rss20.xml"
irb(main):004:0> options = {user_agent: "Stringer (https://github.com/swanson/stringer)", if_modified_since: Time.new(2014, 1, 1), timeout: 30, max_redirects: 2, compress: true} 
=> {:user_agent=>"Stringer (https://github.com/swanson/stringer)", :if_modified_since=>2014-01-01 00:00:00 +0100, :timeout=>30, :max_redirects=>2, :compress=>true}
irb(main):005:0> feed = Feedjira::Feed.fetch_and_parse(url, options)
=> #<Feedjira::Parser::RSS:0x007f826b89b418 @version="2.0", @title="Nyheter från FZ.se", @url="http://www.fz.se/nyheter/", @description="De senaste nyheterna från FZ.se. Uppdateras kontinuerligt.", @entries=[#<Feedjira::Parser::RSSEntry:0x007f826b890838 @title="Då öppnar betan för Star Wars: Battlefront", @url=
pascalw commented 9 years ago

@kaksmet this feed works for me on my Stringer instance (running latest master), so it's likely not a Stringer/Feedjira issue.

It could be that fz.se is blocking requests from some popular hosting providers, like EC2. You can verify this by curling that feed on your server and see if that works.

kaksmet commented 9 years ago

I'm hosting it locally and curling the feed works fine. I am running it in a docker container though, but that shouldn't be the problem since about a dozen other feeds are working as expected.

EDIT: also running latest master

pascalw commented 9 years ago

Ok and did you run that irb session also in the container?

It could also be an encoding issue. I've seen weird encoding related stuff happen before when running in Docker containers which often times don't have proper locale configurations.

kaksmet commented 9 years ago

The issue was encoding related as it works if I configure a proper locale in the docker container.

@pascalw thank you for your help.