public function testParseFullHashResponse() { $raw = "foobar:20:10\n0123456789"; $expected = array(array('listname' => 'foobar', 'add_chunk_num' => 20, 'hash' => bin2hex('0123456789'))); $a = GSB_Client::parseFullhashResponse($raw); $this->assertEquals($expected, $a); $expected = array(array('listname' => 'foobar', 'add_chunk_num' => 20, 'hash' => bin2hex('0123456789')), array('listname' => 'dingbat', 'add_chunk_num' => 30, 'hash' => bin2hex('123456789'))); $raw = "foobar:20:10\n0123456789dingbat:30:9\n123456789"; $a = GSB_Client::parseFullhashResponse($raw); $this->assertEquals($expected, $a); }
#!/usr/bin/env php <?php require_once 'intro.php'; require_once 'GSB_Client.php'; $client = new GSB_Client($storage, $network, $logger); $len = count($argv); for ($i = 1; $i < $len; $i++) { $url = $argv[$i]; $matches = $client->doLookup($url); print "{$url}: " . count($matches) . "\n"; } //$client->doLookup('http://malware.testing.google.test/testing/malware/'); //$client->doLookup('http://www.iospace.com/'); //$client->doLookup('http://the-zen.co.kr/'); //$client->doLookup('http://adingurj.com/'); //$client->doLookup('http://matzines.com/'); // http://online-xp-antivir.com