[OzzModz] RSS Feed Filter

[OzzModz] RSS Feed Filter 2.0.6

No permission to download
suggestion:

would be great if in the future, you allow users to add their own rss,


reason: because user always send me message to allow rss feed their website, it takes many minutes to add their feed, and i am so busy take care of my grandma, have no time

so its much simpler if user do it themselves,

have permission [ ] allow user to add rss feeds


tank you

.
I don't think that will happen. RSS feeds are a back end admin function and I don't think I want to bring that to the front end (user).
 
194703


i will have to find someone else to do it, i had it done for me on xf1 add-on, it work great


good luck

.
 
Before I start debugging on my test install, anybody else having issues with running this on XF 2.1.0? 🤔 With the add-on enabled, no RSS feeds are being retrieved; no errors in the ACP, no posts created, nothing in the XF feed log table, nothing. Disable the add-on, feeds are imported.
 
Before I start debugging on my test install, anybody else having issues with running this on XF 2.1.0? 🤔 With the add-on enabled, no RSS feeds are being retrieved; no errors in the ACP, no posts created, nothing in the XF feed log table, nothing. Disable the add-on, feeds are imported.
I just ran a test feed into my Gold & Silver social group on my site and it worked without a problem. And I know of at least one other site where feeds are working as they should with this add-on (https:///triumphtalk.com most, if not all of this thread is from a feed https://www.triumphtalk.com/threads/motorcycle-eye-candy.50285/post-282914). I'm sure there are more, I just don't track who uses this add-on.

And if you follow the thread on my site, it's obvious it's working for someone there...
 
Last edited:
Before I start debugging on my test install, anybody else having issues with running this on XF 2.1.0? 🤔 With the add-on enabled, no RSS feeds are being retrieved; no errors in the ACP, no posts created, nothing in the XF feed log table, nothing. Disable the add-on, feeds are imported.
OK, had a chance to tear this one apart and finally tracked down what's happening. In short, after touching an existing feed entry after RSS Feed Filter has been installed then my server environment is no longer seeing the $filterWords variable as being empty. Not necessarily a problem but I'm using some corporate XML feeds that do not have a 'content' tag in their RSS item entries. Because of that it then fails the check to see if the $filterWords is found in $entry['content'].

Now the details... :P
  • On a clean XF install add the feed https://global.canon/en/rssfeed/news/index.xml.
  • Install RSS Feed Filter but do not modify the entry for the feed you just added. Instead take a look at the database table xf_feed for the feed you created. The value of "snog_words" column is null.
  • At this point the feed should import fine as expected.
  • Now go in and modify the feed entry. Don't change anything, just go ahead and hit the 'save' button.
  • Go back and look at the database table for the entry - it is no longer null, it is now a blob value.
  • Try to import the feed, likely nothing got imported. Note for testing you'll need to clear your xf_feed_log table for the feed ID in question.
  • The reason nothing got imported is because at around line 40 of /src/addons/Snog/RSS/XF/Service/Feed.php it no longer evaluates as being empty, instead it is seeing an array with a blank value.
    • Because it did not evaluate to empty it is trying to find blank ("") in $entry['content'].
    • For this feed $entry['content'] does not exist so it is failing the conditional and never sets $filterFound to be true.
    • Because $filterFound is not true the current RSS item gets skipped.
    • If $entry['content'] did exist then "" would've been found and $filterFound would've been set to true and the RSS item would not have been skipped.
So for anybody else having issues, start with checking the feed you're using to see if the content tag is present.

For my purposes I'm getting around the issue by changing the $filterFound conditional at line 44 to look in both $entry['content'] and $entry['title'] which, for feeds with no content tag, allows the filter words to still be searched and if filter words are not being used then "" is found in the title which allows for $filterFound to be set to true so the item doesn't get skipped.
 
OK, had a chance to tear this one apart and finally tracked down what's happening. In short, after touching an existing feed entry after RSS Feed Filter has been installed then my server environment is no longer seeing the $filterWords variable as being empty. Not necessarily a problem but I'm using some corporate XML feeds that do not have a 'content' tag in their RSS item entries. Because of that it then fails the check to see if the $filterWords is found in $entry['content'].

Now the details... :p
  • On a clean XF install add the feed https://global.canon/en/rssfeed/news/index.xml.
  • Install RSS Feed Filter but do not modify the entry for the feed you just added. Instead take a look at the database table xf_feed for the feed you created. The value of "snog_words" column is null.
  • At this point the feed should import fine as expected.
  • Now go in and modify the feed entry. Don't change anything, just go ahead and hit the 'save' button.
  • Go back and look at the database table for the entry - it is no longer null, it is now a blob value.
  • Try to import the feed, likely nothing got imported. Note for testing you'll need to clear your xf_feed_log table for the feed ID in question.
  • The reason nothing got imported is because at around line 40 of /src/addons/Snog/RSS/XF/Service/Feed.php it no longer evaluates as being empty, instead it is seeing an array with a blank value.
    • Because it did not evaluate to empty it is trying to find blank ("") in $entry['content'].
    • For this feed $entry['content'] does not exist so it is failing the conditional and never sets $filterFound to be true.
    • Because $filterFound is not true the current RSS item gets skipped.
    • If $entry['content'] did exist then "" would've been found and $filterFound would've been set to true and the RSS item would not have been skipped.
So for anybody else having issues, start with checking the feed you're using to see if the content tag is present.

For my purposes I'm getting around the issue by changing the $filterFound conditional at line 44 to look in both $entry['content'] and $entry['title'] which, for feeds with no content tag, allows the filter words to still be searched and if filter words are not being used then "" is found in the title which allows for $filterFound to be set to true so the item doesn't get skipped.
Thank you for the detailed steps to recreate the problem.

I'll add the title to the filter as you described so both the content and title are checked in the next release.

This has nothing to do with the add-on, but I do question the value of a feed with no content when it results in a post like this...
cannon.webp

Granted you could change the RSS importer to repeat the title in the post, but that seems kind of silly. That's just my opinion, again nothing to do with the add-on. ;)
 
... or you can take advantage of XF 2.1.x & this add on by using filter keywords into a single thread with the title formatted & linked in the post body and then a second link that is unfurled. 😉
 
Snog updated RSS Feed Filter with a new update entry:

RSS Feed Filter Update 2.0.4

  • Fix - Filter words not an empty array in database when not defined
  • Add - Filter title for filter words in addition to content
  • Change - Serialized arrays to Json arrays where applicable due to deprecated XF data type
NOTICE: As of this update, this add-on will no longer install on or update XenForo 2.0 installs and will only work on XenForo 2.1+

The empty array fix does not apply to current feeds. You must re-save your feeds to...

Read the rest of this update entry...
 
Does this serve only to notify you with new topics?

Now my forum is notifying for each reply to the topics
It does not notify about anything. It filters incoming RSS feeds that you have set up in Admin->Forums->RSS feed importer.
 
... or you can take advantage of XF 2.1.x & this add on by using filter keywords into a single thread with the title formatted & linked in the post body and then a second link that is unfurled. 😉
would that work to limit the content? I have some local sites that are not limiting their rss output and I don't want to take the traffic , but I do want to have the image or thumb and maybe 300-500 characters
 
would that work to limit the content? I have some local sites that are not limiting their rss output and I don't want to take the traffic , but I do want to have the image or thumb and maybe 300-500 characters
If they aren't limiting their content in a feed, this won't limit what's in the post created by XF. So if the feed has a very long content, that same content would be posted.

It will limit the number of posts from their feed to X number of posts in the same thread.
 
yeah, I understood that , I was talking about the url unfurling feature. Im trying it now , on the one RSS that is otherwise very short the unfurling worked good when I edited a post , waiting to see if the next on does it by my changing
{content}
More...
to
{link}

one did not work in the preview but im thinking the unfurl happens some timeline that's not on the preview.
 
@rootsxrocks The length of the unfurl snippet is actually an XF defined length and it comes from the actual remote page content, not the RSS feed. In the scenario I described above there'd be two 'pulls', one pull of the remote RSS feed to grab the item links and titles and then if the link is on a line by itself (and you have unfurling turned on) then a second pull would be to the page in the link to grab the snippet from the page source.

The unfurl doesn't show in the RSS preview, only when the post is saved. Putting {link} on a line by itself should get unfurled when the feed is imported. Play around on a test install but to give an idea here's the RSS message template I'm using for the feed I was working with. Attached is a screenshot showing how it looks.
Code:
[b][url="{link}"]{title}[/url][/b]

{link}
1555022523462.webp

... And here's the thread with Chris about the length of the unfurl snippet (Cliff Notes: The maximum length would be 300 by default).
 
Suggestion:
Keywords to filter out content. Instead of a new box you could use a (-) in the list like how google works.

So

tv,news,movie,-politics,hollywood

would filter out politics when using the other keywords
 
Last edited:
Top Bottom