Description of Helpers

author barnabywalters

 Methods

convertHtmlToTwitterSyntax()

convertHtmlToTwitterSyntax($text) 
Static

Parameters

$text

Prepare For Twitter

prepareForTwitter(string $text, string $url, string $inReplyTo) : array
Static

Takes some parameters and returns an array suitable for conversion to a query string and submitting to the twitter API.

$text does not have to be under 140 chars, THE TRUNCENATOR is used internally to truncate the content and append the $url within 140 chars.

If $inReplyTo is set and is a twitter.com status URL, the id will be parsed out of it and added to the in_reply_to_status_id param of the return array.

Note that twitter will not process a tweet as a reply correctly if the @name of the target is not included.

todo Add some intelligent blockquote/other markdown handling

Parameters

$text

string

The body text

$url

string

= null A URL to append to the content, if any

$inReplyTo

string

= null A URL the content is in reply to

Returns

arrayAn assoc. array ready to pass as POST vars to `statuses/update`