TKruzze
1
What is the purpose of ‘Blacklisted tags’ in Preferences?
My initial thought was that it would prevent (remove) a tag in the comma separated list from being imported into the database during feed import. However, it’s not working that way for me.
fox
2
TKruzze
3
Thank you, again, @fox for the quick response and update! I’ve gone ahead and updated my install and the early indications are that it’s working exactly as I had hoped. I’ll update in the next 24 hours if I notice anything otherwise.
Can the blacklist include wildcards? For example, * would filter out all tags.
fox
5
i think this is better suited for a plugin. a hook or two might need to be added though.
Are you sure? Seems like creating a plugin AND a hook for 8 lines of php is overkill.
// Skip boring tags
$boring_tags = array_map('trim',
explode(",", mb_strtolower(
get_pref('BLACKLISTED_TAGS', $owner_uid))));
$entry_tags = FeedItem_Common::normalize_categories(
array_unique(
array_diff($entry_tags, $boring_tags)));
foreach ($boring_tags as $tag_hi): # ignore tag ranges
$tag_lo = str_replace('*', 0x00, $tag_hi);
$tag_hi = str_replace('*', 0xff, $tag_hi);
foreach ($entry_tags as $k=>$entry_tag):
if ($entry_tag >= $tag_lo and $entry_tag <= $tag_hi)
unset($entry_tag[$k]);
endforeach;
endforeach;
Debug::log("filtered tags: " . implode(", ", $entry_tags), Debug::$LOG_VERBOSE);
fox
7
$tag_lo = str_replace('*', 0x00, $tag_hi);
$tag_hi = str_replace('*', 0xff, $tag_hi);
this is the kind of hacks i’d rather not have in trunk.
OK. I’ll look for an unhacky way to do that.
fox
9
the unhacky way would be fnmatch() although i would prefer to not add it either.
this would be the only place where wildcards are used in tt-rss and in general i don’t like the “comma separated list of wildcards” UI very much.
OK, fair enough. I’ll stir up trouble somewhere else. 