]> git.mxchange.org Git - friendica.git/blobdiff - include/Scrape.php
Improvments of the HTML to make a better bb2markdown conversion (nested lists, youtub...
[friendica.git] / include / Scrape.php
index ca8f6e83ae3d9f3b0fa0e2508f76374465c6e722..4f53effe92b3653ea99a2688a2484736721af7bd 100644 (file)
@@ -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);
@@ -564,6 +565,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'];