diff -u -r -N glsuck-0.0.1.orig/docs/ChangeLog glsuck-0.0.1/docs/ChangeLog --- glsuck-0.0.1.orig/docs/ChangeLog 2004-11-03 18:48:03.000000000 -0600 +++ glsuck-0.0.1/docs/ChangeLog 2004-11-08 15:45:54.161064960 -0600 @@ -4,6 +4,16 @@ *yasuck-0.0.1 (03 Nov 2004) + 08 Nov 2004; Mike Green docs/ChangeLog, + glsuck, includes/app.functions.php, includes/globals.php: + + Started framework for combing through local browser cache instead of + retrieving pages from the internet. Will return "Anonymous" as the author + of an article if the author is not specified in the post. Unparsable comment + titles will be set to "Could not parse". Removed some leftovers from yasuck. + Set FETCHSLEEP to 5,20. Turned off randomization of UA by default. Change + back by setting RANDOMIZE_UA to true in includes/globals.php. + 03 Nov 2004; Mike Green docs/ChangeLog, Released to the world :) diff -u -r -N glsuck-0.0.1.orig/glsuck glsuck-0.0.1/glsuck --- glsuck-0.0.1.orig/glsuck 2004-11-03 15:41:22.000000000 -0600 +++ glsuck-0.0.1/glsuck 2004-11-08 15:34:52.312681208 -0600 @@ -29,7 +29,9 @@ } else { toggleLock(NICK,1); } - if (defined('ALL')) { + if (defined('CACHEDIR')) { + die("This piece is not written yet!\n"); + } elseif (defined('ALL')) { $rc = suckArticles(NICK,1); if ($rc === true) { $status = "Done (success)\n"; diff -u -r -N glsuck-0.0.1.orig/includes/app.functions.php glsuck-0.0.1/includes/app.functions.php --- glsuck-0.0.1.orig/includes/app.functions.php 2004-11-03 16:32:40.000000000 -0600 +++ glsuck-0.0.1/includes/app.functions.php 2004-11-08 15:48:42.386490808 -0600 @@ -151,6 +151,16 @@ define(NICK,$nick); return true; break; +/* + case "--usecache": + if (defined('CACHEDIR')) { return false; } + $j++; + $cachedir = $args[$j]; + if (substr($nick,0,2) == "--") { return false; } + if (!is_dir($cachedir)) { return false; } + define(CACHEDIR,$cachedir); + break; +*/ case "--version": if (defined('ACTION')) { return false; } define(ACTION,"version"); @@ -535,6 +545,8 @@ --status NICK Display status of site NICK database --subject SUBJECT Only retrieve messages with subject SUBJECT --version Display version and exit + --usecache DIR Search for articles in cache directory DIR instead of + fetching via the internet. */ $msg = "Usage: $fname ACTION [ARGS] [OPTIONS] @@ -843,7 +855,7 @@ return $line; } -return false; +return "Anonymous"; } @@ -1165,7 +1177,7 @@ return trim($junk[2]); } -return false; +return "0"; } @@ -1627,7 +1639,8 @@ if (!(AUTHOR === strtolower($author))) { return true; } } if ("$author" !== "Anonymous") { - if (!$article_uid = parseArticleUid($page)) { + $article_uid = parseArticleUid($page); + if ($article_uid === false) { echo "ERROR: could not determine uid for article $article_id\n"; return false; } @@ -1778,9 +1791,10 @@ $is_rev = false; if (!$comment_title = parseCommentTitle($comment,$page)) { - echo "ERROR: could not parse title for comment $comment\n"; - continue; - return false; + //echo "ERROR: could not parse title for comment $comment\n"; + //continue; + //return false; + $comment_title = "Could not parse"; } if (!$author = parseCommentAuthor($comment,$page)) { echo "ERROR: cannot determine author for comment $comment\n"; @@ -2135,9 +2149,6 @@ if (!$dbi or DBINCLUDE == '' or !is_file($dbinc)) { $msg .= "ERROR: Invalid or undefined db include ($dbinc)\n"; } -//if (!$yhh or YAHOOHOST == '') { -// $msg .= "ERROR: Invalid or undefined yahoo host (YAHOOHOST)\n"; -// } if (!$fs or FETCHSLEEP == '') { $msg .= "ERROR: Invalid or undefined fetch sleep timeout (FETCHSLEEP)\n"; } @@ -2245,6 +2256,7 @@ } dumpHtml($page,$article); + if (!processArticle($nick_id,$page)) { return false; } diff -u -r -N glsuck-0.0.1.orig/includes/globals.php glsuck-0.0.1/includes/globals.php --- glsuck-0.0.1.orig/includes/globals.php 2004-10-19 10:52:23.000000000 -0500 +++ glsuck-0.0.1/includes/globals.php 2004-11-08 15:36:46.104382240 -0600 @@ -21,12 +21,12 @@ define(USER_AGENT,'Mozilla/5.0 (compatible; Konqueror/3.3; phpcli)'); define(SOCKTIMEOUT,10); //define(FETCHSLEEP,"1,4"); -define(FETCHSLEEP,3,10); +define(FETCHSLEEP,5,20); define(RETRIES,5); // misc settings define(RANDOM_UA,INCDIR . "/agents.txt"); -define(RANDOMIZE_UA,true); +define(RANDOMIZE_UA,false); define(MAXMISSES,50); define(VERSION,"0.0.1"); define(PATCHLEVEL,"");