X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2FScrape.php;h=85c636788910e94f3f3295a3f7b32e939b04acf3;hb=5e3076b5d27f393f1f7c8d97cf5841064bce88e0;hp=ca8f6e83ae3d9f3b0fa0e2508f76374465c6e722;hpb=2a83ebf77f87037c437f957a471764ad0c817235;p=friendica.git diff --git a/include/Scrape.php b/include/Scrape.php index ca8f6e83ae..85c6367889 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -352,10 +352,11 @@ function probe_url($url, $mode = PROBE_NORMAL) { $email_conversant = false; $twitter = ((strpos($url,'twitter.com') !== false) ? true : false); + $lastfm = ((strpos($url,'last.fm/user') !== false) ? true : false); $at_addr = ((strpos($url,'@') !== false) ? true : false); - if(! $twitter) { + if((! $twitter) && (! $lastfm)) { if(strpos($url,'mailto:') !== false && $at_addr) { $url = str_replace('mailto:','',$url); @@ -393,7 +394,10 @@ function probe_url($url, $mode = PROBE_NORMAL) { } if($link['@attributes']['rel'] === 'diaspora-public-key') { $diaspora_key = base64_decode(unamp($link['@attributes']['href'])); - $pubkey = rsatopem($diaspora_key); + if(strstr($diaspora_key,'RSA ')) + $pubkey = rsatopem($diaspora_key); + else + $pubkey = $diaspora_key; $diaspora = true; } } @@ -431,7 +435,7 @@ function probe_url($url, $mode = PROBE_NORMAL) { intval(local_user()) ); if(count($x) && count($r)) { - $mailbox = construct_mailbox_name($r[0]); + $mailbox = construct_mailbox_name($r[0]); $password = ''; openssl_private_decrypt(hex2bin($r[0]['pass']),$password,$x[0]['prvkey']); $mbox = email_connect($mailbox,$r[0]['user'],$password); @@ -564,6 +568,14 @@ function probe_url($url, $mode = PROBE_NORMAL) { $vcard['fn'] = $tid . '@twitter'; } + if($lastfm) { + $profile = $url; + $poll = str_replace(array('www.','last.fm/'),array('','ws.audioscrobbler.com/1.0/'),$url) . '/recenttracks.rss'; + $vcard['nick'] = basename($url); + $vcard['fn'] = $vcard['nick'] . t(' on Last.fm'); + $network = NETWORK_FEED; + } + if(! x($vcard,'fn')) if(x($vcard,'nick')) $vcard['fn'] = $vcard['nick'];