} //open mysql connection //check if update, or full fetch $mysqlUser = "******"; $mysqlPassword = "******"; $mysqlDatabase = "lh_digg"; $diggUser = "******"; // TODO later do dynamic $mysqlUpdatesTable = "linkhive"; $mysqlDiggsTable = "diggs_" . $diggUser; $mysqlStoryTable = "story_data"; $mysqlStoryDiggsTable = "story_diggs"; $mysqlStoryCommentsTable = "story_comments"; require_once 'Services/Digg.php'; ini_set('user_agent', 'linkhive/0.1'); Services_Digg::$appKey = 'http://www.achea.org/'; // echo $argc; // for ($x = 0; $x < $argc; $x++) // echo $argv[$x]; if ($argc < 2) { $command = "help"; #die("grep case " . $argv[0] . " to see possible commands\n"); } else { $command = $argv[1]; } //get the command //open mysql mysql_connect(localhost, $mysqlUser, $mysqlPassword); @mysql_select_db($mysqlDatabase) or die("Unable to select database " . $mysqlDatabase); $isstrictmode = mysql_query("SET sql_mode='STRICT_ALL_TABLES'"); //generate an error when can't insert
<?php $path = realpath('./../'); ini_set('include_path', $path . ':' . ini_get('include_path')); require_once 'Services/Digg.php'; Services_Digg::$appKey = 'http://www.example.com/Services_Digg_Proxy.php'; Services_Digg::$uri = 'http://services.digg.com';