Bot Code - [comment]
| The Bot Todo
| The Bot
|
<?php
class Bot
{
var $pages;
function Bot()
{
// initialize
$this->run();
}
function run()
{
// open a page
$page = new Page($url);
$this->setPageInfo($page);
// open page links
$urls = $page->getLinks();
foreach ($urls as $url)
{
$this->runUrl($url);
}
}
function setPageInfo($page)
{
$this->setPageUrl($page->getUrl());
$this->setPageTitle($page->getTitle());
$this->setPageContent($page->getContent());
$this->setPageLinks($page->getLinks());
}
}
class Page
{
var $url;
var $title;
var $content;
var $links;
function Page($url)
{
$this->setUrl($url);
}
function setUrl($url)
{
$this->url = $url;
}
}
?>
| The Bot Todo
| The Bot
|
Time: 2007-11-22 19:34:50 -- Author: Curtis Moore