3 Commits

Author SHA1 Message Date
troy
ff40210fb6 checkHuman 2022-01-22 11:52:53 +01:00
troy
209bb0b00c domain tipser 2022-01-09 15:15:20 +01:00
troy
6bec287363 die troy api 2022-01-09 13:27:20 +01:00
2 changed files with 26 additions and 0 deletions

View File

@@ -24,4 +24,16 @@ $_ips_crawler = array (
'34.79.234.76', // google '34.79.234.76', // google
'148.251.120.201' // mj12bot '148.251.120.201' // mj12bot
); );
function checkHuman() {
global $_ips_crawler;
if (stripos ( $_SERVER ['HTTP_USER_AGENT'], 'bot' ) !== false) {
return false;
}
foreach ( $_ips_crawler as $np ) {
if (startsWith ( $_SERVER ['REMOTE_ADDR'], $np )) {
return false;
}
}
return true;
}
?> ?>

14
troy-api.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
function sendToTroy($data) {
$url = 'https://troy-grunt.de/api.php';
// use key 'http' even if you send the request to https://...
$options = array (
'http' => array (
'method' => 'POST',
'content' => json_encode ( $data )
)
);
$context = stream_context_create ( $options );
return file_get_contents ( $url, false, $context );
}
?>