fix parsing ugc.fr (new website)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
require_once 'settings.php';
|
||||
|
||||
define('TMP_FOLDER', 'tmp/');
|
||||
define('UGC_URL', 'https://ugc.fr');
|
||||
|
||||
function getPage($sPath, $asVars, $sType)
|
||||
{
|
||||
@@ -15,12 +16,14 @@ function getPage($sPath, $asVars, $sType)
|
||||
}
|
||||
if(!$bSavePage || !file_exists($sFileName) || date('dmY', filemtime($sFileName))!=date('dmY'))
|
||||
{
|
||||
$sUrl = 'http://www.ugc.fr/'.$sPath.'?'.http_build_query($asVars);
|
||||
$sUrl = UGC_URL.'/'.$sPath.'?'.http_build_query($asVars);
|
||||
$oCurl = curl_init();
|
||||
curl_setopt($oCurl, CURLOPT_URL, $sUrl);
|
||||
curl_setopt($oCurl, CURLOPT_HEADER, false);
|
||||
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($oCurl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
|
||||
curl_setopt($oCurl, CURLOPT_REFERER, UGC_URL.'/homepage.html');
|
||||
|
||||
$sContent = curl_exec($oCurl);
|
||||
curl_close($oCurl);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user