<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Code in the hole (Entries tagged as twitter)</title>
    <link>http://codeinthehole.com/</link>
    <description>David Winterbottom</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.3.1 - http://www.s9y.org/</generator>
    
    

<item>
    <title>Phing task to update Twitter status</title>
    <link>http://codeinthehole.com/archives/14-Phing-task-to-update-Twitter-status.html</link>
            <category>Deployment</category>
    
    <comments>http://codeinthehole.com/archives/14-Phing-task-to-update-Twitter-status.html#comments</comments>
    <wfw:comment>http://codeinthehole.com/wfwcomment.php?cid=14</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://codeinthehole.com/rss.php?version=2.0&amp;type=comments&amp;cid=14</wfw:commentRss>
    

    <author>nospam@example.com (David Winterbottom)</author>
    <content:encoded>
    &lt;p&gt;
At &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.tangentlabs.co.uk/&#039;);&quot;  href=&quot;http://www.tangentlabs.co.uk/&quot; title=&quot;Tangent Labs homepage&quot;&gt;Tangent Labs&lt;/a&gt;, we&#039;re currently experimenting with integrating &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/twitter.com/&#039;);&quot;  href=&quot;http://twitter.com/&quot; title=&quot;Twitter home&quot;&gt;Twitter&lt;/a&gt; into our project workflow to provide a latest activity feed in a easily digestible format (for both developers and non-technical people).  For a pilot project, we&#039;ve created a Twitter account and added an SVN post-commit hook script that updates Twitter with the latest commit information (commit message, affected files, author).  We&#039;re going to integrate our bug-tracking software shortly too but that&#039;s not the subject of this post.
&lt;/p&gt;
&lt;p&gt;Instead, I&#039;m going to detail a custom &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phing.info/trac/&#039;);&quot;  href=&quot;http://phing.info/trac/&quot; title=&quot;Phing&quot;&gt;Phing&lt;/a&gt; task I&#039;ve written that updates the project Twitter account.  This allows notices of builds (to test, stage and production) to be integrated into a single feed.  One of the great things about Twitter is its API and the range of applications already written to interact with it.  My current favourite client is &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/launchpad.net/gwibber&#039;);&quot;  href=&quot;https://launchpad.net/gwibber&quot; title=&quot;Gwibber homepage&quot;&gt;Gwibber&lt;/a&gt;, which (amongst other things) displays a small pop-up whenever the account gets a new update.  Having this running while working on the project is great for staying informed with the latest activity, be it new commits, opened tickets or deployments.&lt;/p&gt; 
&lt;p&gt;
The task I&#039;ve written is TwitterUpdateTask.php and should be copied into your &lt;span class=&quot;bash&quot;&gt;$PATH_TO_PHING/ext/my/&lt;/span&gt; folder (create it if it doesn&#039;t exist already).  Mirroring the format of &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/phing.info/docs/guide/current/&#039;);&quot;  href=&quot;http://phing.info/docs/guide/current/&quot; title=&quot;Phing docs&quot;&gt;the Phing docs&lt;/a&gt;, this task has the following attributes:&lt;/p&gt;
&lt;table&gt;
&lt;caption&gt;UpdateTwitterTask.php attributes&lt;/caption&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Type&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;th&gt;Default&lt;/th&gt;&lt;th&gt;Required&lt;/th&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;username&lt;/td&gt;&lt;td&gt;String&lt;/td&gt;&lt;td&gt;Twitter username&lt;/td&gt;&lt;td&gt;n/a&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;password&lt;/td&gt;&lt;td&gt;String&lt;/td&gt;&lt;td&gt;Twitter password&lt;/td&gt;&lt;td&gt;n/a&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;message&lt;/td&gt;&lt;td&gt;String&lt;/td&gt;&lt;td&gt;Update message&lt;/td&gt;&lt;td&gt;n/a&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;checkreturn&lt;/td&gt;&lt;td&gt;Boolean&lt;/td&gt;&lt;td&gt;Whether to check the return code of the request, throws a BuildException the update files.&lt;/td&gt;&lt;td&gt;false&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;p&gt;A simple example build.xml file using this task is as follows:&lt;/p&gt;
&lt;div class=&quot;xml&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;?xml &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; ?&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Simple Twitter update&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;basedir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;default&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;tweet&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;tstamp&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;format&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;property&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;build.time&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;pattern&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;%Y-%m-%d %H:%I&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/tstamp&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;taskdef&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;twitterupdate&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;classname&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;phing.tasks.my.TwitterUpdateTask&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;tweet&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;twitterupdate&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;username&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;example&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;password&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;mypassword&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;message&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Build at ${build.time}&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/project&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;This simply updates the Twitter status with the time of the last build.  A more useful means of using this task is to parameterise the Twitter target to take a specified message so that it can be called from different deployment targets:&lt;/p&gt;
&lt;div class=&quot;xml&quot; style=&quot;text-align: left&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;&lt;/span&gt;?xml &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;1.0&quot;&lt;/span&gt; ?&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;project&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Example Twitter update&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;basedir&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;.&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;default&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-to-test&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;tstamp&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;format&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;property&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;build.time&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;pattern&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;%Y-%m-%d %H:%I&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/tstamp&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;taskdef&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;twitterupdate&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;classname&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;phing.tasks.my.TwitterUpdateTask&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;tweet&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;twitterupdate&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;username&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;dave_test&quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;password&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;eggnog&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;message&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;${twitter.status}&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-to-test&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;tweet&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;twitter.status&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Deploying to test: ${build.time}&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/phingcall&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-to-stage&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;tweet&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;twitter.status&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Deploying to stage: ${build.time}&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/phingcall&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;target&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;deploy-to-production&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;phingcall&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;target&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;tweet&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;twitter.status&quot;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Deploying to production: ${build.time}&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/phingcall&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/target&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/project&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;There are lots of extensions from this idea such as updating Twitter with continuous integration results, failed builds, code coverage metrics.&lt;/p&gt;
&lt;p&gt;The source code for TwitterUpdateTask.php is as follows (with docblocks stripped out for brevity):&lt;/p&gt;
&lt;div class=&quot;php&quot; style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;phing/Task.php&quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; TwitterUpdateTask extends Task &lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; const URL_TEMPLATE_UPDATE&amp;#160; &amp;#160; = &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;http://twitter.com/statuses/update.xml?status=%s&#039;&lt;/span&gt;; &lt;br /&gt;&amp;#160; &amp;#160; const MAXIMUM_MESSAGE_LENGTH = &lt;span style=&quot;color: #cc66cc;&quot;&gt;140&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Twitter response codes &lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_SUCCESS&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #cc66cc;&quot;&gt;200&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_NOT_MODIFIED&amp;#160; &amp;#160; &amp;#160; &amp;#160; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;304&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_BAD_REQUEST&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #cc66cc;&quot;&gt;400&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_BAD_CREDENTIALS&amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #cc66cc;&quot;&gt;401&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_FORBIDDEN&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #cc66cc;&quot;&gt;403&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_BAD_URL&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #cc66cc;&quot;&gt;404&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_SERVER_ERROR&amp;#160; &amp;#160; &amp;#160; &amp;#160; = &lt;span style=&quot;color: #cc66cc;&quot;&gt;500&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_BAD_GATEWAY&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;= &lt;span style=&quot;color: #cc66cc;&quot;&gt;502&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; const HTTP_RESPONSE_SERVICE_UNAVAILABLE = &lt;span style=&quot;color: #cc66cc;&quot;&gt;503&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; private &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/static&#039;);&quot;  href=&quot;http://www.php.net/static&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;static&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;$responseMessages&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_NOT_MODIFIED&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Status hasn&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\&#039;&lt;/span&gt;t changed since last update&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_BAD_REQUEST&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Bad request - you may have exceeded the rate limit&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_BAD_CREDENTIALS&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Your username and password did not authenticate&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_FORBIDDEN&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Forbidden request - Twitter are refusing to honour the request&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_BAD_URL&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;The Twitter URL is invalid&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_SERVER_ERROR&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;There is a problem with the Twitter server&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_BAD_GATEWAY&lt;/span&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;=&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Twitter is either down or being upgraded&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_SERVICE_UNAVAILABLE&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Twitter servers are overloaded and refusing request&#039;&lt;/span&gt;,&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #0000ff;&quot;&gt;$username&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #0000ff;&quot;&gt;$password&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #0000ff;&quot;&gt;$message&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #0000ff;&quot;&gt;$checkReturn&lt;/span&gt; = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setUsername&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$username&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;username&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$username&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setPassword&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;password&lt;/span&gt; = &lt;span style=&quot;color: #0000ff;&quot;&gt;$password&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setMessage&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$message&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;message&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/trim&#039;);&quot;  href=&quot;http://www.php.net/trim&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;trim&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$message&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; setCheckReturn&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$checkReturn&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;checkReturn&lt;/span&gt; = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;boolean&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$checkReturn&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; init&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/extension_loaded&#039;);&quot;  href=&quot;http://www.php.net/extension_loaded&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;extension_loaded&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;curl&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BuildException&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Cannot update Twitter&quot;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;The cURL extension is not installed&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; public &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; main&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;validateProperties&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt; = curl_init&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_setopt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLOPT_POST, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_setopt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLOPT_POSTFIELDS, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_setopt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLOPT_URL, &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getUpdateUrl&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_setopt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLOPT_USERPWD, &lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;$this-&amp;gt;username:$this-&amp;gt;password&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_setopt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLOPT_RETURNTRANSFER, &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_setopt&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLOPT_HTTPHEADER, &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array&#039;);&quot;  href=&quot;http://www.php.net/array&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&#039;Expect:&#039;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$twitterData&lt;/span&gt;&amp;#160; = curl_exec&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$responseCode&lt;/span&gt; = curl_getinfo&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;, CURLINFO_HTTP_CODE&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$errorCode&lt;/span&gt;&amp;#160; &amp;#160; = curl_errno&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$errorMessage&lt;/span&gt; = curl_error&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; curl_close&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$curlHandle&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;#160; &amp;#160; &amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; != &lt;span style=&quot;color: #0000ff;&quot;&gt;$errorCode&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BuildException&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;cURL error ($errorCode): $errorMessage&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;handleTwitterResponseCode&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;int&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$responseCode&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; validateProperties&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;username&lt;/span&gt; || !&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;password&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BuildException&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;You must specify a Twitter username and password&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;!&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BuildException&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;You must specify a message&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;elseif&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/strlen&#039;);&quot;  href=&quot;http://www.php.net/strlen&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;strlen&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &amp;gt; self::&lt;span style=&quot;color: #006600;&quot;&gt;MAXIMUM_MESSAGE_LENGTH&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;message&lt;/span&gt; = &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/substr&#039;);&quot;  href=&quot;http://www.php.net/substr&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;substr&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;message&lt;/span&gt;, &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt;, self::&lt;span style=&quot;color: #006600;&quot;&gt;MAXIMUM_MESSAGE_LENGTH&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Message is greater than the maximum message length - truncating...&quot;&lt;/span&gt;, Project::&lt;span style=&quot;color: #006600;&quot;&gt;MSG_WARN&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&amp;#160; &amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getUpdateUrl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/sprintf&#039;);&quot;  href=&quot;http://www.php.net/sprintf&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;sprintf&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;self::&lt;span style=&quot;color: #006600;&quot;&gt;URL_TEMPLATE_UPDATE&lt;/span&gt;, &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;getEncodedMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; getEncodedMessage&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/urlencode&#039;);&quot;  href=&quot;http://www.php.net/urlencode&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;urlencode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/stripslashes&#039;);&quot;  href=&quot;http://www.php.net/stripslashes&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;stripslashes&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/urldecode&#039;);&quot;  href=&quot;http://www.php.net/urldecode&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;urldecode&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&amp;#160; &lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; handleTwitterResponseCode&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$code&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$code&lt;/span&gt; == self::&lt;span style=&quot;color: #006600;&quot;&gt;HTTP_RESPONSE_SUCCESS&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Twitter status updated to: &#039;$this-&amp;gt;message&#039;&quot;&lt;/span&gt;, Project::&lt;span style=&quot;color: #006600;&quot;&gt;MSG_INFO&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/extlink/www.php.net/array_key_exists&#039;);&quot;  href=&quot;http://www.php.net/array_key_exists&quot;&gt;&lt;span style=&quot;color: #000066;&quot;&gt;array_key_exists&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$code&lt;/span&gt;, self::&lt;span style=&quot;color: #0000ff;&quot;&gt;$responseMessages&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;handleFailedUpdate&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;self::&lt;span style=&quot;color: #0000ff;&quot;&gt;$responseMessages&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$code&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;handleFailedUpdate&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Unrecognised HTTP response code &#039;$code&#039; from Twitter&quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; private &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;function&lt;/span&gt; handleFailedUpdate&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$failureMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt; === &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;checkReturn&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; throw &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; BuildException&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;$failureMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160; &amp;#160; &amp;#160; &amp;#160; &lt;span style=&quot;color: #0000ff;&quot;&gt;$this&lt;/span&gt;-&amp;gt;&lt;span style=&quot;color: #006600;&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&quot;Update unsuccessful: $failureMessage&quot;&lt;/span&gt;, Project::&lt;span style=&quot;color: #006600;&quot;&gt;MSG_WARN&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&amp;#160; &amp;#160;&lt;br /&gt;&amp;#160; &amp;#160; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;&amp;#160;&lt;/div&gt;
&lt;p&gt;
The fully documented source and associated example build.xml file are available to download:&lt;/p&gt;
&lt;p&gt;&amp;raquo; &lt;a onclick=&quot;javascript: pageTracker._trackPageview(&#039;/download/app/downloads/TwitterUpdateTask.zip&#039;);&quot;  href=&quot;http://codeinthehole.com/app/downloads/TwitterUpdateTask.zip&quot;&gt;TwitterUpdateTask.zip (2.6kb)&lt;/a&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Sat, 10 Jan 2009 21:57:00 +0000</pubDate>
    <guid isPermaLink="false">http://codeinthehole.com/archives/14-guid.html</guid>
    <category>phing</category>
<category>php</category>
<category>project management</category>
<category>twitter</category>

</item>

</channel>
</rss>