From 9edf15d3ef0548a35862fab37eee1fd310705285 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 20 Sep 2011 01:49:08 -0700 Subject: structures for batch mode (Diaspora/zot) --- include/Scrape.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/Scrape.php') diff --git a/include/Scrape.php b/include/Scrape.php index 58468a40d..0115bf2e7 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -496,8 +496,10 @@ function probe_url($url, $mode = PROBE_NORMAL) { } if($diaspora && $diaspora_base && $diaspora_guid) { - if($mode == PROBE_DIASPORA || ! $notify) + if($mode == PROBE_DIASPORA || ! $notify) { $notify = $diaspora_base . 'receive/users/' . $diaspora_guid; + $batch = $diaspora_base . 'receive/public' ; + } if(strpos($url,'@')) $addr = str_replace('acct:', '', $url); } @@ -675,6 +677,7 @@ function probe_url($url, $mode = PROBE_NORMAL) { $result['nick'] = $vcard['nick']; $result['url'] = $profile; $result['addr'] = $addr; + $result['batch'] = $batch; $result['notify'] = $notify; $result['poll'] = $poll; $result['request'] = $request; -- cgit v1.2.3 From 38444aedd732d65b2df57c9ebce712dfd53fbf4d Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 20 Sep 2011 17:56:44 -0700 Subject: improvements to Twitter probe --- include/Scrape.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/Scrape.php') diff --git a/include/Scrape.php b/include/Scrape.php index 0115bf2e7..fd41b7bc6 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -534,6 +534,9 @@ function probe_url($url, $mode = PROBE_NORMAL) { else $poll = $tapi . '?screen_name=' . $tid; $profile = 'http://twitter.com/#!/' . $tid; + $vcard['photo'] = 'https://api.twitter.com/1/users/profile_image/' . $tid; + $vcard['nick'] = $tid; + $vcar['fn'] = $tid . '@twitter'; } if(! x($vcard,'fn')) -- cgit v1.2.3 From 8294dde936349a58e2c1a974768f5662f2ca9c2e Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 20 Sep 2011 17:59:18 -0700 Subject: typo in Twitter probe update --- include/Scrape.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/Scrape.php') diff --git a/include/Scrape.php b/include/Scrape.php index fd41b7bc6..a55608c2d 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -536,7 +536,7 @@ function probe_url($url, $mode = PROBE_NORMAL) { $profile = 'http://twitter.com/#!/' . $tid; $vcard['photo'] = 'https://api.twitter.com/1/users/profile_image/' . $tid; $vcard['nick'] = $tid; - $vcar['fn'] = $tid . '@twitter'; + $vcard['fn'] = $tid . '@twitter'; } if(! x($vcard,'fn')) -- cgit v1.2.3 From 9115e9c90b749e1739d412df2d63ae96e0b89b3e Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 20 Sep 2011 18:07:33 -0700 Subject: no need to scrape Twitter profile photo from page - it's no longer there. --- include/Scrape.php | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'include/Scrape.php') diff --git a/include/Scrape.php b/include/Scrape.php index a55608c2d..2af02fff5 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -249,20 +249,6 @@ function scrape_feed($url) { return $ret; - $items = $dom->getElementsByTagName('img'); - - // get img elements (twitter) - - if($items) { - foreach($items as $item) { - $x = $item->getAttribute('id'); - if($x === 'profile-image') { - $ret['photo'] = $item->getAttribute('src'); - } - } - } - - $head = $dom->getElementsByTagName('base'); if($head) { foreach($head as $head0) { -- cgit v1.2.3