-
AuthorPosts
-
December 16, 2022 at 1:21 am #12163Jeff KimmelParticipant
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 is403
and content-type istext/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
December 16, 2022 at 6:02 pm #12167Terence BorgParticipantSame 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 is403
and content-type istext/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.December 16, 2022 at 10:41 pm #12171Aakash ChakravarthyKeymasterHi 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,
AakashDecember 20, 2022 at 3:27 am #12189Jeff KimmelParticipantAakash,
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
December 20, 2022 at 5:28 pm #12197Terence BorgParticipantHi 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,
TerenceDecember 20, 2022 at 10:19 pm #12199Jeff KimmelParticipantAakash,
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’);
}
December 20, 2022 at 10:56 pm #12200Aakash ChakravarthyKeymasterHi 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.
Thanks,
AakashDecember 20, 2022 at 11:38 pm #12204Jeff KimmelParticipantAakash,
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
December 21, 2022 at 12:27 am #12205Aakash ChakravarthyKeymasterHi 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,
AakashDecember 21, 2022 at 1:10 am #12206Terence BorgParticipantI 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.
December 21, 2022 at 4:26 am #12214Jeff KimmelParticipantAakash,
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
December 21, 2022 at 6:29 pm #12215Aakash ChakravarthyKeymasterJeff,
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.
Thanks,
AakashDecember 21, 2022 at 10:29 pm #12221Jeff KimmelParticipantAakssh,
Got it working, thanks for all you help!
Jeff
December 22, 2022 at 11:40 pm #12234Aakash ChakravarthyKeymasterExcellent! 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-postMarking this thread as resolved.
Thanks,
Aakash -
AuthorPosts
- The topic ‘RSS feed not working’ is closed to new replies.