From 3bd12315ab932665130159e29a692d03dcd94abb Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Thu, 26 May 2011 23:09:05 -0500 Subject: [PATCH 01/16] action class to handle posts to multiple services --- custom/Action/Multipost.php | 111 ++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 custom/Action/Multipost.php diff --git a/custom/Action/Multipost.php b/custom/Action/Multipost.php new file mode 100644 index 0000000..e22f6c8 --- /dev/null +++ b/custom/Action/Multipost.php @@ -0,0 +1,111 @@ + + * @link /sync + */ +class Action_Unreadsync extends Frapi_Action implements Frapi_Action_Interface +{ + + /** + * Required parameters + * + * @var An array of required parameters. + */ + protected $requiredParams = array('timeline', 'replies', 'messages', 'key', 'service', 'userid', 'client'); + + /** + * The data container to use in toArray() + * + * @var A container of data to fill and return in toArray() + */ + private $data = array(); + + /** + * To Array + * + * This method returns the value found in the database + * into an associative array. + * + * @return array + */ + public function toArray() + { + return $this->data; + } + + /** + * Default Call Method + * + * This method is called when no specific request handler has been found + * + * @return array + */ + public function executeAction() + { + throw new Frapi_Error('NOT_IMPLEMENTED'); + } + + /** + * Get Request Handler + * + * This method is called when a request is a GET + * + * @return array + */ + public function executeGet() + { + $this->requiredParams = array('service', 'userid'); + $valid = $this->hasRequiredParameters($this->requiredParams); + if ($valid instanceof Frapi_Error) { + return $valid; + } + + $service = $this->getParam('service', self::TYPE_STRING); + $userid = $this->getParam('userid', self::TYPE_STRING); + + $sm = new SpazUnreadSync(); + $sync = $sm->retrieve($service, $userid); + + if(!$sync) { + throw new Frapi_Error('ERROR_RETRIEVING_SYNC'); + } + + return $sync; + } + + /** + * Post Request Handler + * + * + * + * @return array + */ + public function executePost() + { + $valid = $this->hasRequiredParameters($this->requiredParams); + if ($valid instanceof Frapi_Error) { + return $valid; + } + $syncParams = array(); + foreach($this->requiredParams as $param) { + $syncParams[$param] = $this->getParam($param, self::TYPE_STRING); + } + + $sm = new SpazUnreadSync(); + $sync = $sm->sync($syncParams); + + if (!$sync) { + throw new Frapi_Error('ERROR_SAVING_SYNC'); + } + + return $this->toArray(); + } + +} + From 391ee5ccda77479a7466d5bfe173c1a74c9960c1 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Thu, 26 May 2011 23:09:33 -0500 Subject: [PATCH 02/16] interface for multiple post service provider --- custom/Model/Spaz/SpazMultiPost_Interface.php | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 custom/Model/Spaz/SpazMultiPost_Interface.php diff --git a/custom/Model/Spaz/SpazMultiPost_Interface.php b/custom/Model/Spaz/SpazMultiPost_Interface.php new file mode 100644 index 0000000..bb904e9 --- /dev/null +++ b/custom/Model/Spaz/SpazMultiPost_Interface.php @@ -0,0 +1,10 @@ + Date: Thu, 26 May 2011 23:10:58 -0500 Subject: [PATCH 03/16] implementation of Multipost service for Tumblr API --- custom/Model/Spaz/Tumblr.php | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 custom/Model/Spaz/Tumblr.php diff --git a/custom/Model/Spaz/Tumblr.php b/custom/Model/Spaz/Tumblr.php new file mode 100644 index 0000000..6e54f4f --- /dev/null +++ b/custom/Model/Spaz/Tumblr.php @@ -0,0 +1,39 @@ +curl = curl_init(); + } + + public function send($message, $metaData, $authData) + { + $postData = array( + 'email' => $authData['email'], + 'password' => $authData['password'], + 'type' => self::POST_TYPE_REGULAR, + 'title' => $metaData['title'], + 'body' => $message, + 'format' => self::FORMAT_MARKDOWN, + ); + $curlOpts = array( + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POSTFIELDS => $postData, + CURLOPT_URL => $this->apiUrl, + ); + curl_setopt_array($this->curl, $curlOpts); + $data = curl_exec($this->curl); + curl_close($this->curl); + return $data; + } + +} \ No newline at end of file From 3a5324ecb364a9fc6033e9571191e0c67df0e98f Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Thu, 26 May 2011 23:12:56 -0500 Subject: [PATCH 04/16] implementing Multipost action handler for FRAPI --- custom/Action/Multipost.php | 41 +++++++++++-------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/custom/Action/Multipost.php b/custom/Action/Multipost.php index e22f6c8..e61345e 100644 --- a/custom/Action/Multipost.php +++ b/custom/Action/Multipost.php @@ -9,7 +9,7 @@ * @author Frapi * @link /sync */ -class Action_Unreadsync extends Frapi_Action implements Frapi_Action_Interface +class Action_Multipost extends Frapi_Action implements Frapi_Action_Interface { /** @@ -17,7 +17,7 @@ class Action_Unreadsync extends Frapi_Action implements Frapi_Action_Interface * * @var An array of required parameters. */ - protected $requiredParams = array('timeline', 'replies', 'messages', 'key', 'service', 'userid', 'client'); + protected $requiredParams = array('username', 'content', 'services'); /** * The data container to use in toArray() @@ -60,23 +60,7 @@ public function executeAction() */ public function executeGet() { - $this->requiredParams = array('service', 'userid'); - $valid = $this->hasRequiredParameters($this->requiredParams); - if ($valid instanceof Frapi_Error) { - return $valid; - } - - $service = $this->getParam('service', self::TYPE_STRING); - $userid = $this->getParam('userid', self::TYPE_STRING); - - $sm = new SpazUnreadSync(); - $sync = $sm->retrieve($service, $userid); - - if(!$sync) { - throw new Frapi_Error('ERROR_RETRIEVING_SYNC'); - } - - return $sync; + throw new Frapi_Error('NOT_IMPLEMENTED'); } /** @@ -92,16 +76,15 @@ public function executePost() if ($valid instanceof Frapi_Error) { return $valid; } - $syncParams = array(); - foreach($this->requiredParams as $param) { - $syncParams[$param] = $this->getParam($param, self::TYPE_STRING); - } - - $sm = new SpazUnreadSync(); - $sync = $sm->sync($syncParams); - - if (!$sync) { - throw new Frapi_Error('ERROR_SAVING_SYNC'); + $message = $this->getParam('content', self::TYPE_STRING); + foreach ($this->getParam('services') as $service => $authData) { + $serviceHandlerClass = 'Spaz' . $service; + $serviceHandler = new $serviceHandlerClass; + try { + $data[] = $serviceHandler->send($message, $authData); + } catch (Exception $e) { + throw new Frapi_Error($e->getMessage()); + } } return $this->toArray(); From 08d09e95c4875f0d96e184dbfd818a811edf87b5 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Thu, 26 May 2011 23:13:26 -0500 Subject: [PATCH 05/16] added handler for multi_post. probably needs new hash, did not generate via admin --- custom/Config/actions.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/custom/Config/actions.xml b/custom/Config/actions.xml index 035ebdb..2004791 100755 --- a/custom/Config/actions.xml +++ b/custom/Config/actions.xml @@ -118,5 +118,23 @@ + + multi_post + 1 + 1 + Post a new message to multiple services + /:userid/messages + d31eba41d3c31653ae1b26d18e8a10dd7d266253 + + + content + 1 + + + services + 1 + + + From 7d5f2c671e3d45d5e5955c05bfd7efcaa400f1d2 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 16:06:01 -0500 Subject: [PATCH 06/16] implementing linkedin support via multipost API --- custom/Model/Spaz/LinkedIn.php | 71 ++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 custom/Model/Spaz/LinkedIn.php diff --git a/custom/Model/Spaz/LinkedIn.php b/custom/Model/Spaz/LinkedIn.php new file mode 100644 index 0000000..6e07aa4 --- /dev/null +++ b/custom/Model/Spaz/LinkedIn.php @@ -0,0 +1,71 @@ +curl = curl_init(); + } + + /** + * + * Fields for the XML Body + * + * Node Parent Node Required? Value Notes + * share — Yes Child nodes of share Parent node for all share content + * comment share Conditional Text of member's comment. (Similar to deprecated current-status field.) Post must contain comment and/or (content/title and content/submitted-url). Max length is 700 characters. + * content share Conditional Parent node for information on shared document + * title share/content Conditional Title of shared document Post must contain comment and/or (content/title and content/submitted-url). Max length is 200 characters. + * submitted-url share/content Conditional URL for shared content Post must contain comment and/or (content/title and content/submitted-url). + * submitted-image-url share/content Optional URL for image of shared content Invalid without (content/title and content/submitted-url). + * description share/content Option Description of shared content Max length of 400 characters. + * + + Survey: Social networks top hiring tool - San Francisco Business Times + http://sanfrancisco.bizjournals.com/sanfrancisco/stories/2010/06/28/daily34.html + http://images.bizjournals.com/travel/cityscapes/thumbs/sm_sanfrancisco.jpg + + * + * @param string $message + * @param array $metaData + * @param array $authData + * @return string + * + */ + public function send($message, $metaData, $authData) + { + $postData = array( + 'comment' => $message, + 'content' => array( + 'title' => $metaData['title'], + ), + 'visibility' => array( + 'code' => ($metaData['visibility']) ? self::VISIBLE_ANYONE : self::VISIBLE_CONNECTIONS, + ), + ); + $curlOpts = array( + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POSTFIELDS => json_encode($postData), + CURLOPT_URL => $this->apiUrl, + CURLOPT_HTTPHEADER => 'Content-Type: application/json', + ); + curl_setopt_array($this->curl, $curlOpts); + $data = curl_exec($this->curl); + curl_close($this->curl); + return $data; + + /*$http = new HttpRequest($this->apiUrl, HttpRequest::METH_POST); + $http->setContentType('application/json'); + $http->setRawPostData(json_encode($postData)); + $http->send(); + return $http->getResponseData();*/ + } + +} \ No newline at end of file From cdcb89dccd821adb6225fd159b9e0e989f036e8f Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 16:06:29 -0500 Subject: [PATCH 07/16] implementing posterous support via multipost API --- custom/Model/Spaz/Posterous.php | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 custom/Model/Spaz/Posterous.php diff --git a/custom/Model/Spaz/Posterous.php b/custom/Model/Spaz/Posterous.php new file mode 100644 index 0000000..fca8d8b --- /dev/null +++ b/custom/Model/Spaz/Posterous.php @@ -0,0 +1,73 @@ +curl = curl_init(); + } + + /* + * The Posterous Twitter API lets you upload photos to a Posterous site. + * It is used with normal HTTP POST requests. Post data should be formatted + * as multipart/form-data. This API is a drop-in replacement for the Twitpic API. + * + * The API uses Twitter's OAuth Echo method to authenticate the identity of + * a Twitter user. + * + * If the Twitter user is registered on Posterous, it will post to their + * default Posterous site. If the user is not on Posterous, we will create a + * new site for them. The media parameter can be an array of media. This + * includes images, audio, video, and common document formats. + * + * Fields + * "media" - Optional. File data for single file. + * "media[]" - Optional. File data for multiple file upload. Can be specified multiple times. + * + * Headers + * There are two required headers for OAuth Echo: + * X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json + * X-Verify-Credentials-Authorization: Should be the signed OAuth "Authorization" header typically used to call the verify_credentials.json endpoint + */ + public function send($message, $metaData, $authData) + { + $postData = array( + 'message' => $metaData['title'], + 'body' => $message, + 'source' => 'Spaz', + 'sourceLink' => 'http://www.getspaz.com', + ); + if (!empty($metaData['media']) && is_array($metaData['media'])) { + $postData['media'] = $metaData['media']; + } + $headers = array( + 'X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json', + 'X-Verify-Credentials-Authorization: ' . $authData, //signed OAuth "Authorization" header typically used to call the verify_credentials.json endpoint', + ); + $curlOpts = array( + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POSTFIELDS => $postData, + CURLOPT_URL => $this->apiUrl, + CURLOPT_HTTPHEADER => $headers, + ); + curl_setopt_array($this->curl, $curlOpts); + $data = curl_exec($this->curl); + curl_close($this->curl); + return $data; + + /*$headers = array( + 'X-Auth-Service-Provider' => 'https://api.twitter.com/1/account/verify_credentials.json', + 'X-Verify-Credentials-Authorization' => $authData, + ); + $http = new HttpRequest($this->apiUrl, HttpRequest::METH_POST, array('headers' => $headers)); + $http->setPostFields($postData); + $http->send(); + return $http->getResponseData();*/ + } + +} \ No newline at end of file From 56d34c68d86909e710696016c4ab67f08c8eca46 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 16:24:10 -0500 Subject: [PATCH 08/16] removing content field for now, may add back depending on whether user wants to send full content metadata --- custom/Model/Spaz/LinkedIn.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom/Model/Spaz/LinkedIn.php b/custom/Model/Spaz/LinkedIn.php index 6e07aa4..468cead 100644 --- a/custom/Model/Spaz/LinkedIn.php +++ b/custom/Model/Spaz/LinkedIn.php @@ -42,9 +42,9 @@ public function send($message, $metaData, $authData) { $postData = array( 'comment' => $message, - 'content' => array( + /*'content' => array( 'title' => $metaData['title'], - ), + ),*/ 'visibility' => array( 'code' => ($metaData['visibility']) ? self::VISIBLE_ANYONE : self::VISIBLE_CONNECTIONS, ), From 622a5908806235a1a746cd27fbb0cd634ae8617c Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 16:28:21 -0500 Subject: [PATCH 09/16] replacing content in post data array with conditional that only adds content param if all required components are present --- custom/Model/Spaz/LinkedIn.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/custom/Model/Spaz/LinkedIn.php b/custom/Model/Spaz/LinkedIn.php index 468cead..efec70a 100644 --- a/custom/Model/Spaz/LinkedIn.php +++ b/custom/Model/Spaz/LinkedIn.php @@ -42,13 +42,19 @@ public function send($message, $metaData, $authData) { $postData = array( 'comment' => $message, - /*'content' => array( - 'title' => $metaData['title'], - ),*/ 'visibility' => array( 'code' => ($metaData['visibility']) ? self::VISIBLE_ANYONE : self::VISIBLE_CONNECTIONS, ), ); + if (!empty($metaData['title']) && !empty($metaData['url'])) { + $postData['content'] = array( + 'title' => $metaData['title'], + 'submitted-url' => $metaData['url'], + ); + if (!empty($metaData['image_url'])) { + $postData['content']['submitted-image-url'] = $metaData['image_url']; + } + } $curlOpts = array( CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, From 502b3cfe40fb0af6d786e49d9bbf34052fce09c9 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 16:41:17 -0500 Subject: [PATCH 10/16] adding lots of docs --- custom/Model/Spaz/LinkedIn.php | 41 ++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/custom/Model/Spaz/LinkedIn.php b/custom/Model/Spaz/LinkedIn.php index efec70a..c57cdcb 100644 --- a/custom/Model/Spaz/LinkedIn.php +++ b/custom/Model/Spaz/LinkedIn.php @@ -1,11 +1,27 @@ - Survey: Social networks top hiring tool - San Francisco Business Times - http://sanfrancisco.bizjournals.com/sanfrancisco/stories/2010/06/28/daily34.html - http://images.bizjournals.com/travel/cityscapes/thumbs/sm_sanfrancisco.jpg - + * Allowed metadata: + * visibility (boolean) - Whether share is visible to everyone. Default: true + * title (string) - must also include url if this is set + * url (string) - URL to share + * image_url (string) - URL of image to share along with title/url + * description (string) - description of share (optional). Max 400 chars. * * @param string $message * @param array $metaData - * @param array $authData + * @param array $authData Required OAuth credentials * @return string * */ From 922a96edd2ebc4f1b900eea1012f7ff71c9b6ef0 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 16:41:36 -0500 Subject: [PATCH 11/16] support for optional description parameter. max length is not verified as of yet --- custom/Model/Spaz/LinkedIn.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom/Model/Spaz/LinkedIn.php b/custom/Model/Spaz/LinkedIn.php index c57cdcb..e74f1e9 100644 --- a/custom/Model/Spaz/LinkedIn.php +++ b/custom/Model/Spaz/LinkedIn.php @@ -61,6 +61,9 @@ public function send($message, $metaData, $authData) if (!empty($metaData['image_url'])) { $postData['content']['submitted-image-url'] = $metaData['image_url']; } + if (!empty($metaData['description'])) { + $postData['content']['description'] = $metaData['description']; + } } $curlOpts = array( CURLOPT_POST => true, From ee533d1d0bda1f833c4f1055d4e61349790d3673 Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 17:28:42 -0500 Subject: [PATCH 12/16] switching to an encoded string so content type is application/x-www-form-urlencoded. array forces multipart/form-data instead, and that is not required here --- custom/Model/Spaz/Tumblr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom/Model/Spaz/Tumblr.php b/custom/Model/Spaz/Tumblr.php index 6e54f4f..2bd6207 100644 --- a/custom/Model/Spaz/Tumblr.php +++ b/custom/Model/Spaz/Tumblr.php @@ -27,7 +27,7 @@ public function send($message, $metaData, $authData) $curlOpts = array( CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, - CURLOPT_POSTFIELDS => $postData, + CURLOPT_POSTFIELDS => urlencode(implode('&', $postData)), CURLOPT_URL => $this->apiUrl, ); curl_setopt_array($this->curl, $curlOpts); From 6896dc935fb9d79d723eb9ecf6954b5cf5dd0d2e Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 17:29:07 -0500 Subject: [PATCH 13/16] adding docs for posterous version --- custom/Model/Spaz/Posterous.php | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/custom/Model/Spaz/Posterous.php b/custom/Model/Spaz/Posterous.php index fca8d8b..c960afa 100644 --- a/custom/Model/Spaz/Posterous.php +++ b/custom/Model/Spaz/Posterous.php @@ -3,7 +3,15 @@ class SpazPosterous implements SpazMultiPost_Interface { + /** + * Curl handler. Will eventually replace with pecl_http + * @var resource + */ protected $curl; + /** + * API resource URI for uploads on Posterous + * @var string + */ protected $apiUrl = 'https://posterous.com/api2/upload.json'; public function __construct() @@ -16,22 +24,20 @@ public function __construct() * It is used with normal HTTP POST requests. Post data should be formatted * as multipart/form-data. This API is a drop-in replacement for the Twitpic API. * - * The API uses Twitter's OAuth Echo method to authenticate the identity of - * a Twitter user. + */ + /** + * Adds a new upload to the user's Posterous account. * - * If the Twitter user is registered on Posterous, it will post to their - * default Posterous site. If the user is not on Posterous, we will create a - * new site for them. The media parameter can be an array of media. This - * includes images, audio, video, and common document formats. + * Allowed metadata: + * title (string) - title for post/upload + * media (string|array) - one or more files to post (audio, images, video, docs, etc...) * - * Fields - * "media" - Optional. File data for single file. - * "media[]" - Optional. File data for multiple file upload. Can be specified multiple times. + * @param string $message + * @param array $metaData + * @param array $authData Required OAuth credentials (passed to Twitter) + * @return string * - * Headers - * There are two required headers for OAuth Echo: - * X-Auth-Service-Provider: https://api.twitter.com/1/account/verify_credentials.json - * X-Verify-Credentials-Authorization: Should be the signed OAuth "Authorization" header typically used to call the verify_credentials.json endpoint + * @todo add mime type guessing */ public function send($message, $metaData, $authData) { From 9e4c81435a6106261dc293a68f478022c181522b Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 17:44:39 -0500 Subject: [PATCH 14/16] updating docs/code to support/require an array of file paths for media parameter --- custom/Model/Spaz/Posterous.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom/Model/Spaz/Posterous.php b/custom/Model/Spaz/Posterous.php index c960afa..3c43e4f 100644 --- a/custom/Model/Spaz/Posterous.php +++ b/custom/Model/Spaz/Posterous.php @@ -30,7 +30,7 @@ public function __construct() * * Allowed metadata: * title (string) - title for post/upload - * media (string|array) - one or more files to post (audio, images, video, docs, etc...) + * media (array) - one or more paths of files to post (audio, images, video, docs, etc...) * * @param string $message * @param array $metaData @@ -48,6 +48,10 @@ public function send($message, $metaData, $authData) 'sourceLink' => 'http://www.getspaz.com', ); if (!empty($metaData['media']) && is_array($metaData['media'])) { + //append @ so curl knows to treat them as files + foreach ($metaData['media'] as &$path) { + $path = '@' . $path; + } $postData['media'] = $metaData['media']; } $headers = array( From 589d9eef73fc01b876ab8fffa73c9d4e6f9482ac Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 17:45:20 -0500 Subject: [PATCH 15/16] updating pecl_http version to properly support uploaded files instead of lumping them in with postFields --- custom/Model/Spaz/Posterous.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom/Model/Spaz/Posterous.php b/custom/Model/Spaz/Posterous.php index 3c43e4f..d740c5f 100644 --- a/custom/Model/Spaz/Posterous.php +++ b/custom/Model/Spaz/Posterous.php @@ -74,8 +74,12 @@ public function send($message, $metaData, $authData) 'X-Auth-Service-Provider' => 'https://api.twitter.com/1/account/verify_credentials.json', 'X-Verify-Credentials-Authorization' => $authData, ); - $http = new HttpRequest($this->apiUrl, HttpRequest::METH_POST, array('headers' => $headers)); + $media = $postData['media']; + unset($postData['media']); + $http = new HttpRequest($this->apiUrl, HttpRequest::METH_POST); $http->setPostFields($postData); + $http->setPostFiles($media); + $http->setHeaders($headers); $http->send(); return $http->getResponseData();*/ } From e7de02239fac9e5dfbad68c86a3913748464d80f Mon Sep 17 00:00:00 2001 From: Brian Fenton Date: Sun, 5 Jun 2011 17:46:18 -0500 Subject: [PATCH 16/16] removing inaccurate comment --- custom/Model/Spaz/Posterous.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/custom/Model/Spaz/Posterous.php b/custom/Model/Spaz/Posterous.php index d740c5f..f370f6d 100644 --- a/custom/Model/Spaz/Posterous.php +++ b/custom/Model/Spaz/Posterous.php @@ -19,12 +19,6 @@ public function __construct() $this->curl = curl_init(); } - /* - * The Posterous Twitter API lets you upload photos to a Posterous site. - * It is used with normal HTTP POST requests. Post data should be formatted - * as multipart/form-data. This API is a drop-in replacement for the Twitpic API. - * - */ /** * Adds a new upload to the user's Posterous account. *