aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-20 22:59:01 -0700
committerfriendica <info@friendica.com>2012-06-20 22:59:01 -0700
commit91a3a2d55137291cfea3dbe5feb4207bf46971ef (patch)
tree53088d7089ef102ffbc10c770b29e862df851830 /include
parent788a6626ef4bd9607f33bbffd0eea0c05a4578c0 (diff)
downloadvolse-hubzilla-91a3a2d55137291cfea3dbe5feb4207bf46971ef.tar.gz
volse-hubzilla-91a3a2d55137291cfea3dbe5feb4207bf46971ef.tar.bz2
volse-hubzilla-91a3a2d55137291cfea3dbe5feb4207bf46971ef.zip
follow last.fm scrobbles
Diffstat (limited to 'include')
-rw-r--r--include/Scrape.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index ca8f6e83a..947f3f99f 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);
@@ -564,6 +565,13 @@ 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);
+ $network = NETWORK_FEED;
+ }
+
if(! x($vcard,'fn'))
if(x($vcard,'nick'))
$vcard['fn'] = $vcard['nick'];