English corrections, added description, extended explanations

master
Hypolite Petovan 2018-10-11 10:39:59 -04:00
parent ff4d9d52c7
commit 8c600b334d
2 changed files with 28 additions and 29 deletions

@ -0,0 +1,28 @@
The Advanced Content Filter addon enables users to collapse posts in their network stream according to customized rules based on the raw item data.
# A few real life examples
## 1. Collapse all posts containing at least an image
`body matches "/\\[img/"`
Pictures are nice, I'm fine to see them _after a click_ to save space in my stream. I wrote the regular expression pattern without the closing bracket, because some the image tag can be used on its own `[img]` or with a dimension parameter `[img=480x640]`.
## 2. Collapse reshares by specific contacts
`author_link matches "/<name>/" && body matches "/\\[share author=/"`
This rule combines two conditions with the logical operator _AND_ - this means that the second condition will only be evaluated if the first one is true. With `author_link` the rule checks for users with the string `cat_alina` in their profile URL and if it happens, then the second part will check the item body for the string `[share author=` which appears only in reshared items.
## 3. Collapse posts from _inoffiziell_ or _unofficial_ news accounts
`author_name matches "/[ui]noffi(ziell|cial)/i" || body matches "/\\[share author=.*[ui]noffi(cial|ziell)/i"`
I want to filter all those news pages and luckily a lot of them contain the word `inoffiziell` or `unofficial` in their display name. So I search for `(inoffiziell|unofficial)` in the author display name **OR** (logical or) for `(inoffiziell|unofficial)` as attribute in `[share author=` to also catch reshared items. My regular expression `[ui]noffi(ziell|cial)` is a shorter version of `(inoffiziell|unofficial)` and the **i** after the second backslash indicates the pattern is case **i**nsensitive, which means it will match `Inoffiziell` or even `UNOFFICIAL`.
## 4. Collapse all posts _not_ from a specific account
`author_link != 'https://friendica.example.tld/profile/username && body matches "/blubb/"`
This rule matches items that have the word `blubb` in their body and which were not published by the profile `https://friendica.example.tld/profile/username`. Remember that equality operators `==` and `!=` match the exact string against the provided item property, while `matches` that can match a portion of the item property.

@ -1,29 +0,0 @@
# A few real life examples
## 1. Images
`body matches "/\\[img/"`
Pictures are nice and I'm fine to watch them only _on click_ to safe space in my stream and I described the pattern without the closing bracket, because some image tags come in a simple way ( `[img]` ) and others come in such a way `[img=480x640]`.
## 2. Reshares by specific contacts
`author_link matches "/<name>/" && body matches "/\\[share author=/"`
This rule combines two rules with the logical _"and"_ - this means that the second part will only be checked, after the first one became true. With author_link ( for example `author_link matches "/cat_alina/"` ) the rule checks for users with cat_alina string in
profile-URL and if it happens, then the second part will check the item body for `[share author]` which appears only in reshared items.
## 3. _inoffiziell_ or _unofficial_
`author_name matches "/[ui]noffi(ziell|cial)/i" || body matches "/\\[share author=.*[ui]noffi(cial|ziell)/i"`
I want to filter all those news pages and luckily a lot of them contain the word inoffiziell or unofficial. So I search for `(inoffiziell|unofficial)` in author name **or** ( logical or ) for `(inoffiziell|unofficial)` as attribute in `[share author]` to ( as described above ) catch also reshared items. My regex `[ui]noffi(ziell|cial)` describes at least the same as `(inoffiziell|unofficial)` and the **i** after the second backslash tells the regex engine to check case **i**nsensitively for the pattern.
## 4. _not-equal_
`author_link != 'friendica.example.tld/profile/username && body matches "/blubb/"`
This rule matches items that have the word _blubb_ in their body and which were not published by the profile _friendica.example.tld/profile/username_