Created
July 31, 2014 18:52
-
-
Save abrahaj/deb4167370897c110a2d to your computer and use it in GitHub Desktop.
explorer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function retrieveContent($url){ | |
$curl = curl_init (); | |
$header [0] = "Accept: text/xml,application/xml,application/xhtml+xml,"; | |
$header [0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5"; | |
$header [] = "Cache-Control: max-age=0"; | |
$header [] = "Connection: keep-alive"; | |
$header [] = "Keep-Alive: 900"; | |
$header [] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; | |
$header [] = "Accept-Language: en-us,en;q=0.5"; | |
$header [] = "Pragma: "; // browsers keep this blank. | |
curl_setopt ( $curl, CURLOPT_URL, $url ); | |
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); | |
curl_setopt ( $curl, CURLOPT_HTTPHEADER, $header ); | |
curl_setopt ( $curl, CURLOPT_REFERER, 'http://www.quareos.com' ); | |
curl_setopt ( $curl, CURLOPT_ENCODING, 'gzip,deflate' ); | |
curl_setopt ( $curl, CURLOPT_AUTOREFERER, true ); | |
curl_setopt ( $curl, CURLOPT_FOLLOWLOCATION, TRUE ); | |
curl_setopt ( $curl, CURLOPT_RETURNTRANSFER, 1 ); | |
curl_setopt ( $curl, CURLOPT_TIMEOUT, 500 ); | |
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); | |
curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, FALSE); | |
$html = curl_exec ( $curl ); | |
print_r(curl_getinfo($curl)); | |
echo "\n\ncURL error number:" .curl_errno($curl); | |
echo "\n\ncURL error:" . curl_error($$curl); | |
return $html; // and finally, return $html | |
} | |
function test1Action(){ | |
$query="PREFIX oda:<http://open.data.al/oda2.owl#> | |
SELECT ?topic | |
WHERE { | |
?topic rdf:type oda:Topic . | |
} | |
ORDER BY ASC(?topic)"; | |
$url="http://co.idoctor.io:8280/marmotta/sparql/select?query=".urlencode($query)."&output=html&rules=&accept="; | |
$result = $this->retrieveContent("http://co.idoctor.io:8280/marmotta/core/admin/about.html"); | |
echo $result; | |
//$this->_helper->layout()->disableLayout(); | |
// $query = "SELECT ?topic {?topic rdf:type <http://open.data.al/oda2.owl#Topic>}"; | |
// $url = "http://open.data.al&output=html"; | |
// $result = $this->retrieveContent($url); | |
// echo $result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment