#!/usr/bin/php
<?php
define
("VERSION""0.2.0.0");
define("REQUIRED_PHP_VERSION""4.3.0");

// System defaults,  DO NOT EDIT THIS FILE
// Edit tighturl.config.inc.php instead!

global $conn$db$svcname;

$dbhost "localhost";
$dbuser "dbuser";
$dbpass "dbpass";
$dbname "tighturl";
$dbtable "urls";

// URIBL variables
$uribl = array("multi.surbl.org""black.uribl.com");
$uriblurl = array("www.surbl.org""www.uribl.com");

// Text strings and style variables
$svcname "URLSquisher";

// You REALLY don't want to edit below here unless you know what you're doing.

// *************************************************************************

  
if (version_compare(phpversion(), REQUIRED_PHP_VERSION)<0) {
    die(
"$svcname Error: TightURL ".VERSION." needs PHP >= ".REQUIRED_PHP_VERSION." (you are using ".phpversion().")");
  }

// ****** !All overridable configuration variables must go above this line! ******

  
if (file_exists("tighturl.config.inc.php")) include("tighturl.config.inc.php");

  
// Connect to MySQL, open database.
  
$conn = @mysql_connect($dbhost$dbuser$dbpass) or die("$svcname Error: Cannot connect to database.");
  
$db mysql_select_db($dbname$conn) or die("$svcname Error: Cannot select database. "mysql_error());
   
  
$req "SELECT * FROM $dbtable order by id;";
  
$set mysql_query($req);
  
$rows = @mysql_num_rows($set) or $rows 0;

  for (
$i 0$i <$rows$i++) {

    
$row mysql_fetch_array($set);
    
$id $row["id"];
    
$url $row["url"];

    
$hit URI_on_URIBL($url);
    echo 
"id: $id  domain: $hit  url: $url\n";
  }

  exit;

// *************************************************************************

?>