aboutsummaryrefslogtreecommitdiffstats
path: root/include/Scrape.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-07-11 18:28:13 -0700
committerFriendika <info@friendika.com>2011-07-11 18:28:13 -0700
commit180c15cdf86172edf58b071149e10af648ec90d4 (patch)
treea901e3dca7fa7d8a06683ba1fd5ad8de7f353e5b /include/Scrape.php
parent2a65d01ce29eff486dcffc47c9d297e1eb7472ea (diff)
downloadvolse-hubzilla-180c15cdf86172edf58b071149e10af648ec90d4.tar.gz
volse-hubzilla-180c15cdf86172edf58b071149e10af648ec90d4.tar.bz2
volse-hubzilla-180c15cdf86172edf58b071149e10af648ec90d4.zip
zot scraper
Diffstat (limited to 'include/Scrape.php')
-rw-r--r--include/Scrape.php24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/Scrape.php b/include/Scrape.php
index fbfec176f..3599d7df3 100644
--- a/include/Scrape.php
+++ b/include/Scrape.php
@@ -300,6 +300,8 @@ function probe_url($url) {
if(count($links)) {
logger('probe_url: found lrdd links: ' . print_r($links,true), LOGGER_DATA);
foreach($links as $link) {
+ if($link['@attributes']['rel'] === NAMESPACE_ZOT)
+ $zot = unamp($link['@attributes']['href']);
if($link['@attributes']['rel'] === NAMESPACE_DFRN)
$dfrn = unamp($link['@attributes']['href']);
if($link['@attributes']['rel'] === 'salmon')
@@ -379,6 +381,25 @@ function probe_url($url) {
}
}
+ if(strlen($zot)) {
+ $s = fetch_url($zot);
+ if($s) {
+ $j = json_decode($s);
+ if($j) {
+ $network = NETWORK_ZOT;
+ $vcard = array(
+ 'fn' => $j->name,
+ 'nick' => $j->username,
+ 'photo' => $j->photo
+ );
+ $profile = $j->url;
+ $notify = $j->post;
+ $key = $j->pubkey;
+ $poll = 'N/A';
+ }
+ }
+ }
+
if(strlen($dfrn)) {
$ret = scrape_dfrn($dfrn);
if(is_array($ret) && x($ret,'dfrn-request')) {
@@ -390,7 +411,7 @@ function probe_url($url) {
}
}
- if($network !== NETWORK_DFRN && $network !== NETWORK_MAIL) {
+ if($network !== NETWORK_ZOT && $network !== NETWORK_DFRN && $network !== NETWORK_MAIL) {
$network = NETWORK_OSTATUS;
$priority = 0;
@@ -549,6 +570,7 @@ function probe_url($url) {
$result['priority'] = $priority;
$result['network'] = $network;
$result['alias'] = $alias;
+ $result['key'] = $key;
logger('probe_url: ' . print_r($result,true), LOGGER_DEBUG);