Example #1
0
 public function ParseAFD($givenID)
 {
     $this->startParseTime = date('Y-m-d H:i:s');
     $GLOBALS['log'] .= "<hr/><span class='startCall'>****************** Call ParseAFD->ParseAFD() </span>";
     $this->afd = AFD::loadFromDBByAFDID($givenID);
     $this->givenAFDID = $givenID;
     $this->afdURL = $this->afd->AFDURL;
     $this->givenHTML = $this->afd->AFDHTML;
     $this->setLog();
     //call parse
     if ($this->afd->flag_toBeRemoved != 1) {
         $this->parseAFDContent();
     }
     $this->endParseTime = date('Y-m-d H:i:s');
     $parseDuration = round((strtotime($this->endParseTime) - strtotime($this->startParseTime)) / 3600 * 60, 2);
     //$GLOBALS['log'] .= "<br/> this->parsed_resultError=$this->parsed_resultError ";
     //$GLOBALS['log'] .= "<br/> this->parsed_CommentError=$this->parsed_CommentError ";
     //$GLOBALS['log'] .= "<br/> this->totalParsed_Comment=$this->totalParsed_Comment ";
     $GLOBALS['log'] .= "<br/> Parsed Duration: " . $parseDuration * 60 . " Sec.";
     $GLOBALS['log'] .= "<br/><span class='endCall'>**** End Called ParseAFD->ParseAFD()*******************</span>";
     echo $GLOBALS['log'];
     $GLOBALS['log'] = "";
 }
<?php

require_once "classes/config.php";
require_once "classes/Crawler.php";
require_once "classes/DebateDateList.php";
require_once "classes/functions.php";
require_once "classes/AFD.php";
ini_set('MAX_EXECUTION_TIME', -1);
$AFDURL = trim($_GET["AFDURL"]);
if (empty($AFDURL)) {
    die("AFDURL={$AFDURL} is empty!");
}
echo AFD::getHTMLByURL($AFDURL);
<?php

require_once "classes/config.php";
require_once "classes/Crawler.php";
require_once "classes/DebateDateList.php";
require_once "classes/functions.php";
require_once "classes/AFD.php";
ini_set('MAX_EXECUTION_TIME', -1);
echo '<link rel="stylesheet" type="text/css" href="style.css">';
echo '<br/>';
$id = trim($_GET["id"]);
if (!is_numeric($id)) {
    die("id={$id} is not number!");
}
echo AFD::getHTMLByID($id);