Zaktualizowano dane połączenia FTP oraz dodano nowe klasy w autoload, a także zmodyfikowano logikę w klasie Cron dla dynamicznego ustawiania głębokości zapytań.

This commit is contained in:
2025-12-07 22:39:06 +01:00
parent 60c7119858
commit 009141455c
2 changed files with 140 additions and 9 deletions

View File

@@ -261,26 +261,37 @@ class Cron
{
$client = new RestClient( 'https://api.dataforseo.com/', null, 'pyziak84@gmail.com', '0p4rYWDNoK63eUUw' );
$last_position = $mdb -> get( 'pro_rr_phrases_positions', 'position', [ 'AND' => [ 'phrase_id' => $row['id'] ], 'ORDER' => [ 'date' => 'DESC' ] ] );
if ( $last_position <= 10 ) {
$depth = 30;
} elseif ( $last_position <= 30 ) {
$depth = 50;
} else {
$depth = 100;
}
if ( $row['localization'] and (int)$row['localization'] )
{
$post_array[0] = array(
"language_name" => "Polish",
"language_code" => "pl",
"location_code" => $row['localization'],
"keyword" => mb_convert_encoding( $row['phrase'], "UTF-8" ),
"priority" => 1,
'postback_data' => 'advanced',
'postback_url' => 'http://www.rank24.pl/dsf.php?d4s-id=$id'
'postback_url' => 'http://www.rank24.pl/dsf.php?d4s-id=$id',
'depth' => $depth
);
}
else
{
$post_array[0] = array(
"language_name" => "Polish",
"language_code" => "pl",
"location_code" => $row['localization'],
"keyword" => mb_convert_encoding( $row['phrase'], "UTF-8" ),
"priority" => 1,
'postback_data' => 'advanced',
'postback_url' => 'http://www.rank24.pl/dsf.php?d4s-id=$id'
'postback_url' => 'http://www.rank24.pl/dsf.php?d4s-id=$id',
'depth' => $depth
);
}