]> git.mxchange.org Git - friendica.git/commitdiff
Remove obsolete Twitter probing
authorHypolite Petovan <hypolite@mrpetovan.com>
Sat, 6 Jun 2020 19:08:21 +0000 (15:08 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Sat, 6 Jun 2020 19:08:21 +0000 (15:08 -0400)
- Profile page source offers no details about accounts when not logged in

src/Network/Probe.php

index d4545e72583a018368138b55819f75b2b9281b2e..ff364d12a17935de455c1253c35251008ee6b19a 100644 (file)
@@ -1745,39 +1745,6 @@ class Probe
                $data['network'] = Protocol::TWITTER;
                $data['baseurl'] = 'https://twitter.com';
 
-               $curlResult = Network::curl($data['url'], false);
-               if (!$curlResult->isSuccess()) {
-                       return [];
-               }
-
-               $body = $curlResult->getBody();
-               $doc = new DOMDocument();
-               @$doc->loadHTML($body);
-               $xpath = new DOMXPath($doc);
-
-               $list = $xpath->query('//img[@class]');
-               foreach ($list as $node) {
-                       $img_attr = [];
-                       if ($node->attributes->length) {
-                               foreach ($node->attributes as $attribute) {
-                                       $img_attr[$attribute->name] = $attribute->value;
-                               }
-                       }
-
-                       if (empty($img_attr['class'])) {
-                               continue;
-                       }
-
-                       if (strpos($img_attr['class'], 'ProfileAvatar-image') !== false) {
-                               if (!empty($img_attr['src'])) {
-                                       $data['photo'] = $img_attr['src'];
-                               }
-                               if (!empty($img_attr['alt'])) {
-                                       $data['name'] = $img_attr['alt'];
-                               }
-                       }
-               }
-
                return $data;
        }