Compare commits
3 Commits
feature/we
...
ff40210fb6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff40210fb6 | ||
|
|
209bb0b00c | ||
|
|
6bec287363 |
@@ -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
14
troy-api.php
Normal 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 );
|
||||||
|
}
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user