ActivityPub Probe Diagnostic'; $o .= '
'; $o .= 'Lookup URI:
'; $o .= 'or paste text:
'; $o .= '
'; $o .= '

'; if(x($_REQUEST,'addr')) { $addr = $_REQUEST['addr']; $headers = 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams", application/activity+json, application/ld+json'; $redirects = 0; $x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]); if($x['success']) $o .= '
' . htmlspecialchars($x['header']) . '
' . EOL; $o .= '
' . htmlspecialchars($x['body']) . '
' . EOL; $o .= 'verify returns: ' . str_replace("\n",EOL,print_r(HTTPSig::verify($x),true)) . EOL; $text = $x['body']; } else { $text = $_REQUEST['text']; } if($text) { // if($text && json_decode($text)) { // $normalized1 = jsonld_normalize(json_decode($text),[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]); // $o .= str_replace("\n",EOL,htmlentities(var_export($normalized1,true))); // $o .= '
' . json_encode($normalized1, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . '
'; // } $o .= '
' . str_replace(['\\n','\\'],["\n",''],htmlspecialchars(jindent($text))) . '
'; $AP = new ActivityStreams($text); $o .= '
' . htmlspecialchars($AP->debug()) . '
'; } return $o; } }