Permalink
Browse files

Add travis_ip_check.php

  • Loading branch information...
Bara committed Nov 30, 2018
1 parent 7e6eb3e commit d4a6d09c758e9c1853727982a13f03130b096f40
Showing with 80 additions and 0 deletions.
  1. +80 −0 addons/sourcemod/scripting/tests/travis_ip_check.php
@@ -0,0 +1,80 @@
<?php
$content = file_get_contents("https://dnsjson.com/nat.travisci.net/A.json");
echo $content;
$array = json_decode($content, true);
print_r($array);
if (!in_array("54.208.31.17", $array["results"]["records"], true))
{
echo "1 - No";
}
else
{
echo "1 - Yes";
}
if (!in_array("54.208.31.15", $array["results"]["records"], true))
{
echo "2 - No";
}
else
{
echo "2 - Yes";
}
?>
/* Resuls
{"success":true,"results":{"name":"nat.travisci.net","type":"A","records":["23.251.144.230","34.233.56.198","34.234.4.53","35.184.96.71","35.184.226.236","35.188.1.99","35.188.73.34","35.192.85.2","35.192.136.167","35.192.187.174","35.193.7.13","35.202.145.110","35.224.112.202","35.232.158.140","35.239.89.243","52.3.55.28","52.45.185.117","52.45.220.64","52.54.31.11","52.54.40.118","54.208.31.17","104.154.113.151","104.154.120.187","104.154.255.220","207.254.16.35","207.254.16.36","207.254.16.37","207.254.16.38","207.254.16.39"]}}<br>
Array
(
[success] => 1
[results] => Array
(
[name] => nat.travisci.net
[type] => A
[records] => Array
(
[0] => 23.251.144.230
[1] => 34.233.56.198
[2] => 34.234.4.53
[3] => 35.184.96.71
[4] => 35.184.226.236
[5] => 35.188.1.99
[6] => 35.188.73.34
[7] => 35.192.85.2
[8] => 35.192.136.167
[9] => 35.192.187.174
[10] => 35.193.7.13
[11] => 35.202.145.110
[12] => 35.224.112.202
[13] => 35.232.158.140
[14] => 35.239.89.243
[15] => 52.3.55.28
[16] => 52.45.185.117
[17] => 52.45.220.64
[18] => 52.54.31.11
[19] => 52.54.40.118
[20] => 54.208.31.17
[21] => 104.154.113.151
[22] => 104.154.120.187
[23] => 104.154.255.220
[24] => 207.254.16.35
[25] => 207.254.16.36
[26] => 207.254.16.37
[27] => 207.254.16.38
[28] => 207.254.16.39
)
)
)
1 - Yes
2 - No
*/

0 comments on commit d4a6d09

Please sign in to comment.