Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • Jeff Kimmel
    Participant

    I’m trying to use the RSS feed from RFIDJournal found here:

    https://www.rfidjournal.com/category/news/feed

    I’m getting the following error:

    RSS Error: A feed could not be found at https://www.rfidjournal.com/category/news/feed; the status code is 403 and content-type is text/html; charset=UTF-8

    The feed did not validate using the on line validator saying the XML has blank lines at the top. Is there any setting we can do to get this working?

    Thanks,

    Jeff

    Terence Borg
    Participant

    Same issue here. getting RSS Error: “RSS Error: A feed could not be found at https://axholdingsltd.peoplehr.net/Pages/JobBoard/CurrentOpenings.aspx?o=ec8d42ba-1b1a-4997-a673-515492f2e31e; the status code is 403 and content-type is text/html; charset=UTF-8

    I have been using it for quite some time and never had issues. All of a sudden this happened.
    What could be the issue? As the rss is working.

    Hi Jeff, Terrence,

    The error code 403 means “prohibited”.
    The RSS feed server is not allowing certain readers/servers to access that feed.

    Can you please paste the code below in your website and see if it works?

    function srr_set_user_agent( &$feed, $url ) {
        $feed->set_useragent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36');
    }
    add_filter( 'wp_feed_options', 'srr_set_user_agent', 10, 2 );

    Thanks,
    Aakash

    Jeff Kimmel
    Participant

    Aakash,

    Thanks for the reply but where do I copy that to? I’m using the wordpress plug in & I have a bunch of files i could put it in but I’m not sure where it should go.

    Thanks,

    Jeff

    Terence Borg
    Participant

    Hi Aakash,

    Same question as Jeff. I use WordPress and use the Super Rss Reader Pro as a plugin.

    This happened all of a sudden now. Do you think it is an issue from the RSS server I am trying to read from?

    Thanks,
    Terence

    Jeff Kimmel
    Participant

    Aakash,

    I searched the code on our site & tried to add what you mentioned into Utilities.php in ‘plugins\super-rss-reader\includes\Utilities.php’. It’s a static class so I changed a couple things but it didn’t help the issue. Where does this need to go? Below are the contents of Utilities.php for review.

    Thanks,

    Jeff

    public static function init(){

    add_filter( ‘the_excerpt_rss’, array( __CLASS__, ‘insert_featured_image_rss_feed’ ) );
    add_filter( ‘the_content_feed’, array( __CLASS__, ‘insert_featured_image_rss_feed’ ) );
    add_filter( ‘wp_feed_options’, ‘srr_set_user_agent’, 10, 2 );
    }

    public static function insert_featured_image_rss_feed( $content ){

    global $post;

    preg_match_all( ‘~<img.*?src=[“\’]+(.*?)[“\’]+~’, $content, $image_urls );

    if( empty( $image_urls[1] ) && has_post_thumbnail( $post->ID ) ) {
    $content = ‘<p>’ . get_the_post_thumbnail( $post->ID ) . ‘</p>’ . $content;
    }

    return $content;

    }

    public static function srr_set_user_agent( &$feed, $url ) {

    $feed->set_useragent(‘Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36’);

    }

    Hi Jeff, Terrence,

    Yes, the RSS server for somereason prohibits requests from your site. They might block it based on the user agent, IP of the server etc.

    The code I shared above will change the user agent and mimic a normal user. Hopefully the server is ok with that.

    You can install a plugin like “code snippets” and paste the code in that.

    Code Snippets

    Thanks,
    Aakash

    Jeff Kimmel
    Participant

    Aakash,

    I added the code snippet & copy and pasted what you showed & it still isn’t working. Like I said before, the RSS feed that is received has blank lines at the beginning & it didn’t validate. I’m not sure where to go from here.

    Jeff

    Hi Jeff,

    Yes, the issue with the space. I get the below error.

    RSS Error: https://www.rfidjournal.com/category/news/feed is invalid XML, likely due to invalid characters. XML error: Reserved XML Name at line 5, column 39

    I can suggest the following,

    1) Inform the website owner and fix the RSS output.
    2) Copy and paste the RSS feed content to your website as a .xml file which is valid. Provide this file as RSS feed URL. Note: you migtht have to do this manually (or) do some kind of automation.
    3) Write some PHP script which will act as proxy, clean the RSS feed (remove blank lines) and return a valid feed.

    I understand the suggestions are quite difficult, but just like any application the plugin accepts a valid RSS feed URL. The plugin cannot tweak and make the feed valid automatically. RSS feed parsers expect a valid one.

    Thanks,
    Aakash

    Terence Borg
    Participant

    I believe I too found the issue from my end. The RSS feed provider is on Cloudflare and it has a browser integrety check enabled. I believe this is impacting us.

    https://support.cloudflare.com/hc/en-us/articles/200170086-Understanding-the-Cloudflare-Browser-Integrity-Check

    Jeff Kimmel
    Participant

    Aakash,

    Thanks for the feedback. I created a little program that calls the feed & saves the xml file. In testing, it looks like the RSS is using the cached version of the file (I removed the file on the server & the feed was still working). Is there any way to set the reader to not cache?

    Terence,

    We’re a MS shop and the program I wrote is in c#, would you like the code snippet that I’m using? It might help your issue if you can get the feed in an XML file.

    Thanks,

    Jeff

    Jeff,

    WordPress caches the RSS feed for 12 hours by default. You can override the cache during testing by adding dummy characters like ?1.
    Example: http://mysitecom/rss.xml?1 Change the number and save the settings everytime you want to override the cache.

    You can also change the refresh duration permanently by placing the code below.

    FAQ

    Thanks,
    Aakash

    Jeff Kimmel
    Participant

    Aakssh,

    Got it working, thanks for all you help!

    Jeff

    Excellent! Thanks for using Super RSS Reader!

    Please do rate the plugin 5 stars if you like it.
    https://wordpress.org/support/plugin/super-rss-reader/reviews/#new-post

    Marking this thread as resolved.

    Thanks,
    Aakash

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘RSS feed not working’ is closed to new replies.

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms