Add (political checks)
This commit is contained in:
@@ -49,6 +49,8 @@ public static function handleSingle($rss_url, $hours = 3)
|
||||
continue;
|
||||
}
|
||||
|
||||
$blacklist_rss_post_keywords = array_merge($blacklist_rss_post_keywords, get_country_names(true));
|
||||
|
||||
foreach ($blacklist_rss_post_keywords as $blacklist_keyword)
|
||||
{
|
||||
if (str_contains(strtolower($title), $blacklist_keyword))
|
||||
|
||||
@@ -147,6 +147,28 @@ public static function handle(int $rss_post_id)
|
||||
$rss_post->status = 'published';
|
||||
}
|
||||
|
||||
if (!$rss_post->status != 'blocked')
|
||||
{
|
||||
if (isset($post_meta_response->output->is_ai_or_tech_news))
|
||||
{
|
||||
if ($post_meta_response->output->is_ai_or_tech_news != true)
|
||||
{
|
||||
$rss_post->status = 'blocked';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($post_meta_response->output->is_government_or_political_news))
|
||||
{
|
||||
if($post_meta_response->output->is_ai_or_tech_news == true)
|
||||
{
|
||||
$rss_post->status = 'blocked';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($rss_post->save()) {
|
||||
|
||||
if ($rss_post->status == 'published') {
|
||||
|
||||
Reference in New Issue
Block a user