Skip to content

Instantly share code, notes, and snippets.

@xhezairbey
Created December 10, 2012 15:55
Show Gist options
  • Save xhezairbey/4251431 to your computer and use it in GitHub Desktop.
Save xhezairbey/4251431 to your computer and use it in GitHub Desktop.
A simple class to retrieve Seitwert.de results
<?php
class Seitwert {
private $key;
private $api;
function __construct() {
$this->key = "yourseitwertkeyhere";
$this->api = "http://www.seitwert.de/api/getseitwert.php?";
}
public function print_xml($url) {
$data = http_build_query(array("url" => $url,
"api" => $this->key));
$xml = file_get_contents($this->api.$data);
$obj = simplexml_load_string($xml);
return $obj;
}
}
$url = htmlentities($_GET['url']);
$sw = new Seitwert();
foreach ($sw->print_xml($url) as $key=>$value)
echo ucfirst($key)." <strong>".$value."</strong>\n<br/>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment