$bParse = isset($_REQUEST['parse']) || isset($_REQUEST['fetch_and_parse']); if (isset($_REQUEST['search_html'])) { if (isset($_REQUEST['url'])) { $aWhere = array('url' => array('%like%' => $_REQUEST['url'])); $oHtml = DirectDB::oSelectOne('ads_htmls', $aWhere, 'id , url', 'ORDER BY fetched DESC LIMIT 1'); ODT::vDump($oHtml); } } if ($bFetch) { Ad::vDeleteDuplicateUrlAds(); WgGesuchtReader::vFetch(); } if ($bParse) { $iParse = intval($_REQUEST['parse']); if ($iParse) { $oAd = WgGesuchtReader::oParseHtml($iParse); ODT::vDump($oAd); $oHtml = Ad::oGetHtml($iParse); ODT::vDump($oHtml); } else { $aHtmlIDs = Ad::aGetLatestHtmlIDs('999 days'); foreach ($aHtmlIDs as $iID) { WgGesuchtReader::oParseHtml($iID); } } } if (isset($_REQUEST['show'])) { $oHtml = Ad::oGetHtml($_REQUEST['show']); $sHtml = $oHtml->html; echo $sHtml; }
public static function vInit() { self::$sDomain = 'ww' . 'w.w' . 'g-g' . 'esuch' . 't.de'; if (!file_exists(self::$sImagesFolder)) { mkdir(self::$sImagesFolder, 0777, true); } }