$data = [];
- // This is ugly - but pump.io doesn't seem to know a better way for it
- $data["name"] = trim($xpath->query("//h1[@class='media-header']")->item(0)->nodeValue);
- $pos = strpos($data["name"], chr(10));
- if ($pos) {
- $data["name"] = trim(substr($data["name"], 0, $pos));
+ $data["name"] = $xpath->query("//span[contains(@class, 'p-name')]")->item(0)->nodeValue;
+
+ if ($data["name"] == '') {
+ // This is ugly - but pump.io doesn't seem to know a better way for it
+ $data["name"] = trim($xpath->query("//h1[@class='media-header']")->item(0)->nodeValue);
+ $pos = strpos($data["name"], chr(10));
+ if ($pos) {
+ $data["name"] = trim(substr($data["name"], 0, $pos));
+ }
+ }
+
+ $data["location"] = $xpath->query("//p[contains(@class, 'p-locality')]")->item(0)->nodeValue;
+
+ if ($data["location"] == '') {
+ $data["location"] = $xpath->query("//p[contains(@class, 'location')]")->item(0)->nodeValue;
}
- $avatar = $xpath->query("//img[@class='img-rounded media-object']")->item(0);
+ $data["about"] = $xpath->query("//p[contains(@class, 'p-note')]")->item(0)->nodeValue;
+
+ if ($data["about"] == '') {
+ $data["about"] = $xpath->query("//p[contains(@class, 'summary')]")->item(0)->nodeValue;
+ }
+
+ $avatar = $xpath->query("//img[contains(@class, 'u-photo')]")->item(0);
+ if (!$avatar) {
+ $avatar = $xpath->query("//img[@class='img-rounded media-object']")->item(0);
+ }
if ($avatar) {
foreach ($avatar->attributes as $attribute) {
if ($attribute->name == "src") {
}
}
- $data["location"] = $xpath->query("//p[@class='location']")->item(0)->nodeValue;
- $data["about"] = $xpath->query("//p[@class='summary']")->item(0)->nodeValue;
-
return $data;
}