Skip to content

Commit

Permalink
Merge pull request #204 from peviitor-ro/nou-3
Browse files Browse the repository at this point in the history
update v0/update
  • Loading branch information
sebiboga committed Jul 6, 2024
2 parents 6b3d734 + d9f4b3c commit d175b7d
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions v0/update/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@
* )
*/

function city_fix($in){
$output = $in;
$output = str_replace("Bucharest","București",$output);
$output = str_replace("Brasov","Brașov",$output);
$output = str_replace("Timisoara","Timișoara",$output);
$output = str_replace("Pitesti","Pitești",$output);
$output = str_replace("Iasi","Iași",$output);
$output = str_replace("Targu Mures","Târgu Mureș",$output);
$output = str_replace("Cluj Napoca","Cluj-Napoca",$output);

return $output;
}

function discord_webhook($msg) {
function city_fix($in){
$output = $in;
$output = str_replace("Bucharest","București",$output);
$output = str_replace("Brasov","Brașov",$output);
$output = str_replace("Timisoara","Timișoara",$output);
$output = str_replace("Pitesti","Pitești",$output);
$output = str_replace("Iasi","Iași",$output);
$output = str_replace("Targu Mures","Târgu Mureș",$output);
$output = str_replace("Cluj Napoca","Cluj-Napoca",$output);

return $output;
}

function discord_webhook($msg) {
$msg .= ' UPDATE in TEST '.date("l d-m-Y H:i:s");
$method = 'POST';
$url = "https://discord.com/api/webhooks/1127592366614786118/ZOcdq94sqxO4P8iOIkQdRLG9s_vwgRfg1DFxhybwpHkqyet0QTe33rQ7bSDS5AG5HP8n";
Expand All @@ -57,11 +57,13 @@ function discord_webhook($msg) {
'content' => $data
)
);

$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);

if ($result === FALSE) { /* Handle error */ }
}
}

$method = 'POST';
$server = '172.18.0.10:8983';
$core = 'jobs';
Expand All @@ -76,6 +78,8 @@ function discord_webhook($msg) {
$qs = $qs . '&';
$qs = $qs . 'wt=json';

$url = 'http://' . $server . $core . $command . $qs;

$data = file_get_contents('php://input');

$json = json_decode($data);
Expand All @@ -97,13 +101,11 @@ function discord_webhook($msg) {
'content' => $data
)
);

discord_webhook($company);
$context = stream_context_create($options);

foreach ($server as $solrurl){
$url = 'http://' . $server . $core . $command . $qs;
$result = file_get_contents($url, false, $context);

if ($result === FALSE) { /* Handle error */ }
}

?>
?>

0 comments on commit d175b7d

Please sign in to comment.