TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

April 16, 2024, 08:44:51 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,161
  • Total Topics: 21,219
  • Online today: 106
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

Some RSS Feeds Working and Others Are Not. TP - 2.0.1 - RSS Feed Bug?

Started by Michael Vail, April 13, 2021, 01:04:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Michael Vail

Link to my forum: https://sonomacountydsa.org/forums
SMF version: SMF ver. 2.0.18
TP version: TP ver. 2.0.1
Default Forum Language: English
Theme name and version: Default (Curve)
Browser Name and Version: Chrome, Firefox, Edge - All Current Versions
Mods installed: See attached image of package manager
Related Error messages: None

Hello and thank you for reading my post.

I recently moved over to Tiny Portal from Simple Portal. I brought 3 RSS feeds over and added them to the lower panel of my SMF 2.0.18 Forum with the latest version of TP (2.0.1) installed. Two of the feeds (both FoxNews feeds) display as expected, however the one for Police One displays nothing but an empty block. They all worked when I ws running on Simple Portal.

A search of other posts revealed nothing helpful or similar to this issue where the feed link is good but doesn't work on a Tiny Portal block but works on other sites, and other feeds work ok.

I have also tried moving the block to other parts of the panel to no avail. I even copied the link to another RSS feed block that works with a different feed and still nothing so I know the block settings aren't the issue.

I still have another site on the same hosting account using Simple Portal. The same Police One block on the Simple Portal RRS block still works fine on that site, which rules out a hosting issue.

The feed link I'm using is the one provided by the Police One website shown below:

https://www.police1.com/law-enforcement-police-rss-feeds/news.xml

I was wondering if someone could test the feed on their Tiny Portal site to see if it works for them and also if anyone can point me to a potential fix to for the feed on my site.

Is it possible this is an unknown bug?

Any help would be appreciated.

Happy Monday!
Mike V.

lurkalot

Hi Mike.

Not sure what's happening on your site, but that feed works fine for me in TP 2.0.1 as you can hopefully see here, http://lts4.byethost7.com/testsite5/index.php

@rjen

Mick, I tried it too, and this feed does not work for me either (on 2.1.0)

I am getting these errors in the log:

../public_html/test2/Sources/TPSubs.php (Line 1789)  Backtrace information

Type of error: General
Error messageSelect
2: simplexml_load_file(https://www.police1.com/law-enforcement-police-rss-feeds/news.xml): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden

and

../public_html/test2/Sources/TPSubs.php (Line 1789)  Backtrace information

Type of error: General
Error messageSelect
2: simplexml_load_file(): I/O warning : failed to load external entity "https://www.police1.com/law-enforcement-police-rss-feeds/news.xml"
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Try this in place of that function.

simplexml_load_string(file_get_contents($file));

It's a bug in php and entities so probably why lurkalot doesn't get it but you do @rjen

@rjen

Quote from: tino on April 13, 2021, 09:02:33 AM
Try this in place of that function.

simplexml_load_string(file_get_contents($file));

It's a bug in php and entities so probably why lurkalot doesn't get it but you do @rjen

That takes care of the second error, but not the first. The RSS block is still empty and getting this error..

https://test.fjr-club.nl/index.php??
2: file_get_contents(https://www.police1.com/law-enforcement-police-rss-feeds/news.xml): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/test/Sources/TPSubs.php
Regel: 1789
Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on April 13, 2021, 03:01:49 PM
Quote from: tino on April 13, 2021, 09:02:33 AM
Try this in place of that function.

simplexml_load_string(file_get_contents($file));

It's a bug in php and entities so probably why lurkalot doesn't get it but you do @rjen

That takes care of the second error, but not the first. The RSS block is still empty and getting this error..

https://test.fjr-club.nl/index.php??
2: file_get_contents(https://www.police1.com/law-enforcement-police-rss-feeds/news.xml): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden
Bestand: /home/deb77453/domains/fjr-club.nl/public_html/test/Sources/TPSubs.php
Regel: 1789

That's from the server you are querying. I'm guessing your region is banned from accessing it. Or something is different in the request to what lurkalot has. Either way that's on the remote server side not local.

tino

If you try this in a php block does it work?

<?php

$opts 
= array(
  
'http'=>array(
    
'user_agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13',
    
'method'=>"GET",
    
'header'=> implode("\r\n", array(
        
'Content-type: text/plain;',
      )
    )
  )
);

$context stream_context_create($opts);
$url 'https://www.police1.com/law-enforcement-police-rss-feeds/news.xml';
$xml file_get_contents($urlfalse$context);
$xml simplexml_load_string($xml);
var_dump($xml);

?>



I don't suggest you adopt that in TinyPortal mind, but it might allow the request through, by faking being a browser.

@rjen

Running Latest TP on SMF2.1 at: www.fjr-club.nl

tino

Quote from: @rjen on April 13, 2021, 06:28:59 PM
Well it does do something....

It just dumps the xml to screen, so the remote side must have security checks to make sure the user agent is valid.

@rjen

Interesting would be to know what the remote side considers a 'valid agent'... and since the OP stated that his SimplePortal site did work... 

:hmm:

Is TP not a valid agent?
  :tickedoff:
Running Latest TP on SMF2.1 at: www.fjr-club.nl