Skip to content

Instantly share code, notes, and snippets.

@stwalkerster
Created March 12, 2013 04:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stwalkerster/5140290 to your computer and use it in GitHub Desktop.
Save stwalkerster/5140290 to your computer and use it in GitHub Desktop.
block test script - takes an array of IPs and spits the lcally blocked ones back at you.
<?php
ini_set("user_agent", "stw-block-script/1.0 ( User:Stwalkerster )");
$iplist = array( "127.0.0.1" );
header("Content-Type: text/plain");
foreach($iplist as $ip){
$data = (unserialize(file_get_contents("http://en.wikipedia.org/w/api.php?action=query&list=blocks&format=php&bkusers=$ip")));
if( count( $data["query"]["blocks"]) != 0 )
echo $ip . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment