1
0
Fork 0

follow last.fm scrobbles

This commit is contained in:
friendica 2012-06-20 22:59:01 -07:00
parent 788a6626ef
commit 91a3a2d551

View file

@ -352,10 +352,11 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$email_conversant = false; $email_conversant = false;
$twitter = ((strpos($url,'twitter.com') !== false) ? true : 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); $at_addr = ((strpos($url,'@') !== false) ? true : false);
if(! $twitter) { if((! $twitter) && (! $lastfm)) {
if(strpos($url,'mailto:') !== false && $at_addr) { if(strpos($url,'mailto:') !== false && $at_addr) {
$url = str_replace('mailto:','',$url); $url = str_replace('mailto:','',$url);
@ -564,6 +565,13 @@ function probe_url($url, $mode = PROBE_NORMAL) {
$vcard['fn'] = $tid . '@twitter'; $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);
$network = NETWORK_FEED;
}
if(! x($vcard,'fn')) if(! x($vcard,'fn'))
if(x($vcard,'nick')) if(x($vcard,'nick'))
$vcard['fn'] = $vcard['nick']; $vcard['fn'] = $vcard['nick'];