From c2475f88539ba8053596acd17be39ad0aec98bb4 Mon Sep 17 00:00:00 2001 From: James Walker Date: Tue, 9 Feb 2010 15:37:37 -0500 Subject: in progress Salmon responses --- plugins/OStatus/lib/Salmon.php | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugins/OStatus/lib/Salmon.php (limited to 'plugins/OStatus/lib/Salmon.php') diff --git a/plugins/OStatus/lib/Salmon.php b/plugins/OStatus/lib/Salmon.php new file mode 100644 index 000000000..8c77222a6 --- /dev/null +++ b/plugins/OStatus/lib/Salmon.php @@ -0,0 +1,64 @@ +. + * + * @package StatusNet + * @author James Walker + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ +class Salmon +{ + public function post($endpoint_uri, $xml) + { + if (empty($endpoint_uri)) { + return FALSE; + } + + $headers = array('Content-type: application/atom+xml'); + + try { + $client = new HTTPClient(); + $client->setBody($xml); + $response = $client->post($endpoint_uri, $headers); + } catch (HTTP_Request2_Exception $e) { + return false; + } + if ($response->getStatus() != 200) { + return false; + } + + } + + public function createMagicEnv($text, $userid) + { + + + } + + + public function verifyMagicEnv($env) + { + + + } +} -- cgit v1.2.3-54-g00ecf