diff options
author | zotlabs <mike@macgirvin.com> | 2017-07-17 22:17:40 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-07-17 22:17:40 -0700 |
commit | d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6 (patch) | |
tree | 046c636a6bdc05d9c5a2f2571476731b47fba373 /Zotlabs | |
parent | 42abc2201c8e7c3798ddfe2fd32300d211035364 (diff) | |
download | volse-hubzilla-d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6.tar.gz volse-hubzilla-d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6.tar.bz2 volse-hubzilla-d8c93c0d13133d336e2cc3dbf3c48e0a6350c2d6.zip |
activitypub, cont.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/ActivityStreams2.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Ap_probe.php | 33 |
2 files changed, 34 insertions, 1 deletions
diff --git a/Zotlabs/Lib/ActivityStreams2.php b/Zotlabs/Lib/ActivityStreams2.php index 46852886b..904782bf7 100644 --- a/Zotlabs/Lib/ActivityStreams2.php +++ b/Zotlabs/Lib/ActivityStreams2.php @@ -43,7 +43,7 @@ class ActivityStreams2 { function fetch_property($url) { $redirects = 0; $x = z_fetch_url($url,true,$redirects, - ['headers' => [ 'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"']]); + ['headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"']]); if($x['success']) return json_decode($x['body'],true); return null; diff --git a/Zotlabs/Module/Ap_probe.php b/Zotlabs/Module/Ap_probe.php new file mode 100644 index 000000000..4649914d5 --- /dev/null +++ b/Zotlabs/Module/Ap_probe.php @@ -0,0 +1,33 @@ +<?php +namespace Zotlabs\Module; + +require_once('include/zot.php'); + + +class Ap_probe extends \Zotlabs\Web\Controller { + + function get() { + + $o .= '<h3>ActivityPub Probe Diagnostic</h3>'; + + $o .= '<form action="ap_probe" method="get">'; + $o .= 'Lookup URI: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />'; + $o .= '<input type="submit" name="submit" value="Submit" /></form>'; + + $o .= '<br /><br />'; + + if(x($_GET,'addr')) { + $addr = $_GET['addr']; + + $redirects = 0; + $x = z_fetch_url($addr,true,$redirects, + [ 'headers' => [ 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"']]); +logger('fetch: ' . print_r($x,true)); + + if($x['success']) + $o .= '<pre>' . str_replace('\\','',jindent($x['body'])) . '</pre>'; + } + return $o; + } + +} |