RSS Reader Problem

  1. 2 weeks ago

    Robert W

    Mar 21 Western Canada

    I built the RSS Reader example project from Javier Menendez's excellent blog:
    https://blog.xojo.com/tag/rss/
    I got it up and running quickly. It worked exactly as described. Then I modified it to suit my needs. Basically, I want to receive various news feeds. I got that part working too, at least partially. It works fine for some news feeds, but for others, it fails to load the content.
    These are the news feed URLs that I've been testing:
    BBC Britain:
    http://feeds.bbci.co.uk/news/rss.xml
    http://feeds.bbci.co.uk/news/world/rss.xml
    http://feeds.bbci.co.uk/news/science_and_environment/rss.xml
    US Networks:
    https://feeds.nbcnews.com/nbcnews/public/news
    https://www.cnbc.com/id/100003114/device/rss/rss.html
    http://feeds.abcnews.com/abcnews/moneyheadlines
    https://www.cbsnews.com/latest/rss/main
    CBC Canada:
    https://www.cbc.ca/cmlink/rss-topstories
    https://www.cbc.ca/cmlink/rss-world
    https://www.cbc.ca/cmlink/rss-offbeat
    ABC Australia:
    https://www.abc.net.au/news/feed/4535882/rss.xml (rural)
    https://www.abc.net.au/news/feed/51120/rss.xml (just in)

    They all work except for the US Network feeds. However, if I open them in a regular web browser, then they all work (including US Networks). I'm trying to figure out why the US Network feeds refuse to work in the Xojo RSS reader. My guess is that they are expecting to see something like a User Agent string and aren't getting it. I know how to set a user agent in an HTMLviewer control, but there doesn't appear to be anything equivalent in an HTTPSecureSocket. Also, I added event handlers for authentication required, proxy authentication required, and error, but none of these are triggered.

    Any ideas what the problem could be?

    did you remember to set Secure = true and the ConnectionType to SSLV23 so it would negotiate the right type ?

  2. Timothy J

    Mar 21 Pre-Release Testers, Xojo Pro

    Try changing the super of the RSS reader to HTTPSecureSocket

  3. Robert W

    Mar 21 Western Canada

    That had been the first thing I changed when I adapted the application to news feeds.

    I've noticed that the ones that don't work are occasionally (but not always) triggering an error event in the RSSreader. And they occasionally (but not always) return a httpStatus value of 0.

  4. Norman P

    Mar 21 Pre-Release Testers, Xojo Pro Answer outside enjoying the fresh air

    did you remember to set Secure = true and the ConnectionType to SSLV23 so it would negotiate the right type ?

  5. Robert W

    Mar 21 Western Canada

    @Norman P did you remember to set Secure = true and the ConnectionType to SSLV23 so it would negotiate the right type ?

    Aha! That was the problem. Thanks Norman.

  6. Javier M

    Mar 23 Xojo Inc

    I have updated the project so it uses now URLConnection instead, removes the need of a Delegate and adds it's own Refresh Event Definition to the subclass.

    You can download the project here

or Sign Up to reply!