Update (rss)
This commit is contained in:
@@ -18,7 +18,9 @@ public static function handle(int $rss_post_id)
|
||||
return;
|
||||
}
|
||||
|
||||
if (count_words($rss_post->body) < 250)
|
||||
$final_content = "TITLE: {$rss_post->title} \n BODY:" . $rss_post->body;
|
||||
|
||||
if (count_words($final_content) < 250)
|
||||
{
|
||||
$rss_post->status = 'blocked';
|
||||
$rss_post->save();
|
||||
@@ -33,7 +35,7 @@ public static function handle(int $rss_post_id)
|
||||
if (! is_null($rss_post->metadata)) {
|
||||
$post_meta_response = $rss_post->metadata;
|
||||
} else {
|
||||
$post_meta_response = OpenAI::getRssPostMetaGpt3($rss_post->body, 1536, 30);
|
||||
$post_meta_response = OpenAI::getRssPostMetaGpt3($final_content, 1536, 30);
|
||||
|
||||
if ((isset($post_meta_response->output)) && (! is_null($post_meta_response->output))) {
|
||||
$service_cost_usage = new ServiceCostUsage;
|
||||
@@ -149,11 +151,11 @@ public static function handle(int $rss_post_id)
|
||||
|
||||
$rss_post->keyword_list = implode(',', $words_to_add_in_keyword_list);
|
||||
|
||||
if (is_empty($rss_post->bites)) {
|
||||
$rss_post->status = 'blocked';
|
||||
} else {
|
||||
$rss_post->status = 'published';
|
||||
}
|
||||
// if (is_empty($rss_post->bites)) {
|
||||
// $rss_post->status = 'blocked';
|
||||
// } else {
|
||||
// $rss_post->status = 'published';
|
||||
// }
|
||||
|
||||
if (!$rss_post->status != 'blocked')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user