<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Stuart Ford &#187; PHP</title>
	<atom:link href="http://www.stuartford.me.uk/category/technology/development-technology/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stuartford.me.uk</link>
	<description>I speak my mind involuntarily. It&#039;s both a blessing and a curse.</description>
	<lastBuildDate>Fri, 20 Jan 2012 09:40:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Flattening LaTeX source files for use with conversion software</title>
		<link>http://www.stuartford.me.uk/2011/06/flattening-latex-source-files-for-use-with-conversion-software/</link>
		<comments>http://www.stuartford.me.uk/2011/06/flattening-latex-source-files-for-use-with-conversion-software/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 12:39:18 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Latex]]></category>
		<category><![CDATA[Notebook]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1383</guid>
		<description><![CDATA[I've been working with LaTeX quite a bit recently and I came across a very silly shortcoming that some of the programs that convert LaTeX to other formats suffer from. It's moronic, but certain of them (pandoc, I'm looking at you), don't follow includes (i.e. \input commands). I have a PHP script which compiles all [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I've been working with <a href="http://www.latex-project.org/">LaTeX</a> quite a bit recently and I came across a very silly shortcoming that some of the programs that convert LaTeX to other formats suffer from. It's moronic, but certain of them (pandoc, I'm looking at you), <strong>don't follow includes</strong> (i.e. \input commands).</p>
<p>I have a PHP script which compiles all my LaTeX source files into various destination formats, including PDF, HTML, MediaWiki markup and text, and so in order to compensate for this ridiculous incapability I added this function which creates a "flattened" version of any LaTeX file by inserting the contents of any included files at the point they are included. It's recursive, so if those included files also include files, they too are processed.</p>
<p>It's simple but effective. Pass the path to the file to flatten. A string is returned with the entire flattened file. You may need to pay attention to relative paths in your \input commands if you includes are in sub-directories.</p>
<p><pre class="brush: php">function FlattenLatexSourceFile($path) {
	
	// read in file
	$src = file($path);
	$flattened = &quot;&quot;;

	// process each line
	foreach ($src as $line) {
		
		if (preg_match(&quot;/^\\\input/&quot;,$line)) {

			// include (input) line, extract filename and recurse
			
			$input = trim($line);
			$input = preg_replace(&quot;/^\\\input\{/&quot;,&quot;&quot;,$input);
			$input = preg_replace(&quot;/\}/&quot;,&quot;&quot;,$input);
			
			if (substr($input,-4,4) != &quot;.tex&quot;) $input = &quot;{$input}.tex&quot;;
			
			$flattened .= &quot;% {$line}\n&quot;;
			$flattened .= FlattenLatexSourceFile($input);
			$flattened .= &quot;\n% (end of included file {$input})\n&quot;;
			
		} else {
			
			// normal line
			$flattened .= $line;
			
		}
		
	}
	
	// return flattened file
	return $flattened;
	
}</pre></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2011%2F06%2Fflattening-latex-source-files-for-use-with-conversion-software%2F&amp;title=Flattening%20LaTeX%20source%20files%20for%20use%20with%20conversion%20software" id="wpa2a_2">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2011/06/flattening-latex-source-files-for-use-with-conversion-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Vacancy</title>
		<link>http://www.stuartford.me.uk/2011/04/php-vacancy/</link>
		<comments>http://www.stuartford.me.uk/2011/04/php-vacancy/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 14:07:42 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Birmingham]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1343</guid>
		<description><![CDATA[We're hiring for a Software Engineer at work to join our technical team based in Birmingham city centre (Jewellery Quarter). If you're looking for a challenging PHP role and you think you might fit the bill, please do drop me a line with your current CV. Full job specification below. Please don't be put off [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>We're hiring for a Software Engineer at work to join our technical team based in Birmingham city centre (Jewellery Quarter). If you're looking for a challenging PHP role and you think you might fit the bill, please do <a href="mailto:stuart.ford@glide.uk.com">drop me a line</a> with your current CV. Full job specification below. Please don't be put off by the crappy website, we're literally just about to launch its replacement :)</p>
<p><a href="http://www.glide.uk.com/">Glide</a> is a rapidly growing energy and telecommunications company specialising in looking after tenants, landlords, letting agents and property investors across the UK. They supply gas, electricity, telephony and broadband services to residential and commercial customers.</p>
<h3>About Glide</h3>
<p>They believe in hard work in an informal atmosphere that encourages people to express their ideas. They look for talented people who want to work with technology and can tackle problems in a smart and creative way. Their employees enjoy working in a challenging environment that brings out the best in them. Customers and customer service are at the heart of everything they do - their business revolves around their customers.</p>
<p>They have their own in-house development, customer support and sales teams and remain focused on keeping their costs low through automation and keeping customers informed through good communication. As technology evolves, they aim to bring new and improved services to their customers as early as possible.</p>
<h3>About The Role</h3>
<p>They currently have an opportunity for a full-time senior software engineer, starting immediately, as part of their in-house software team.</p>
<p>The role will focus on developing their bespoke systems. Their systems are written in object-orientated PHP with a SQL database. You will need to be a highly competent programmer  in PHP, SQL, Javascript, AJAX, Smarty templates, Model-View-Controller and in documenting your work. Good familiarity with Ubuntu/Debian based systems is required. Experience with invoicing routines, SVN or accountancy systems would be useful.</p>
<p>The role will involve working on projects to develop existing products, launch new products and services, improve internal customer service systems, update and maintain accountancy systems and invoicing scripts, debugging and diagnosing problems with their existing code base and working closely with their customer service teams. The role also includes integrating their system with multiple third party suppliers, redeveloping customer portals and revamping their website.</p>
<p>You will be enthusiastic about new technology, eager to learn, and will hold a degree in Computer Science or equivalent. You will be capable of managing your own time.</p>
<h3>Application Details</h3>
<p>The company is a place where everyone can be heard. If you like the sound of this opportunity, they'd love to hear from you. Please direct your communication and correspondence through my team or <a href="mailto:stuart.ford@glide.uk.com">direct to me</a>. Please view the website at<a href="http://www.glide.uk.com/"> www.glide.uk.com</a> for more background information to assist you with your response.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2011%2F04%2Fphp-vacancy%2F&amp;title=PHP%20Vacancy" id="wpa2a_4">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2011/04/php-vacancy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ternary PHP short-hand if/else statement</title>
		<link>http://www.stuartford.me.uk/2011/04/ternary-php-short-hand-ifelse-statement/</link>
		<comments>http://www.stuartford.me.uk/2011/04/ternary-php-short-hand-ifelse-statement/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 15:48:48 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Notebook]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1294</guid>
		<description><![CDATA[Saves using a cumbersome multi-line control structure for simple conditions like this: // normal control structure if (statement) { $variable = true; } else { $variable = false; } // short-hand equivalent $var = (statement) ? true : false; // useful return statements in functions return (statement) ? true : false;]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Saves using a cumbersome multi-line control structure for simple conditions like this:</p>
<p><pre class="brush: php">// normal control structure
if (statement) {
	$variable = true;
} else {
	$variable = false;
}

// short-hand equivalent
$var = (statement) ? true : false;

// useful return statements in functions
return (statement) ? true : false;</pre></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2011%2F04%2Fternary-php-short-hand-ifelse-statement%2F&amp;title=Ternary%20PHP%20short-hand%20if%2Felse%20statement" id="wpa2a_6">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2011/04/ternary-php-short-hand-ifelse-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chart API PHP classes</title>
		<link>http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/</link>
		<comments>http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/#comments</comments>
		<pubDate>Thu, 14 Apr 2011 13:04:45 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1262</guid>
		<description><![CDATA[Following on from my recent release of AGCDR (Asterisk CDR Statistics), I thought I would make an important sub-set of that project available separately. As part of writing AGCDR I wrote a reasonably extensive set of PHP classes to interact with the Google Chart API. The following chart types are supported, although some do not [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>Following on from <a href="/2011/03/asterisk-cdr-statistics/">my recent release of AGCDR</a> (Asterisk CDR Statistics), I thought I would make an important sub-set of that project available separately. As part of writing AGCDR I wrote a reasonably extensive set of <a href="http://php-chart-api.googlecode.com/">PHP classes to interact with the Google Chart API</a>. The following chart types are supported, although some do not support all the features that the <a href="http://code.google.com/apis/chart/">API</a> offers:</p>
<ul>
<li><a href="http://code.google.com/apis/chart/docs/gallery/bar_charts.html">Bar charts</a></li>
<li><a href="http://code.google.com/apis/chart/docs/gallery/line_charts.html">Line charts</a></li>
<li><a href="http://code.google.com/apis/chart/docs/gallery/googleometer_chart.html">Meters</a></li>
<li><a href="http://code.google.com/apis/chart/docs/gallery/pie_charts.html">Pie charts</a></li>
<li><a href="http://code.google.com/apis/chart/docs/gallery/radar_charts.html">Radar charts</a></li>
<li><a href="http://code.google.com/apis/chart/docs/gallery/scatter_charts.html">Scatter charts</a></li>
<li><a href="http://code.google.com/apis/chart/docs/gallery/venn_charts.html">Venn charts</a></li>
</ul>
<p>The <a href="http://code.google.com/p/php-chart-api/downloads/list">download</a> contains all the classes, both in separate files and in a combined file (which one you will use will likely depend on whether or not you use class auto-loaders) plus a page of example usages to get you going.</p>
<p>As with AGCDR, this is currently being released as a beta so it's not perfect and I would welcome comments, suggestions and bug reports. Please submit any comments, suggestions or indeed any code you would like to contribute via the <a href="http://php-chart-api.googlecode.com/">Google Code page</a> in order that all information pertaining to it is kept in the same place.</p>
<p>Here's a gallery of examples:</p>

<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/barchart_horizontal/' title='BarChart_Horizontal'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/BarChart_Horizontal-150x150.png" class="attachment-thumbnail" alt="BarChart_Horizontal" title="BarChart_Horizontal" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/barchart_vertical/' title='BarChart_Vertical'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/BarChart_Vertical-150x150.png" class="attachment-thumbnail" alt="BarChart_Vertical" title="BarChart_Vertical" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/linechart_basic/' title='LineChart_Basic'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/LineChart_Basic-150x150.png" class="attachment-thumbnail" alt="LineChart_Basic" title="LineChart_Basic" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/meterchart_basic/' title='MeterChart_Basic'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/MeterChart_Basic-150x150.png" class="attachment-thumbnail" alt="MeterChart_Basic" title="MeterChart_Basic" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/piechart_flat/' title='PieChart_Flat'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/PieChart_Flat-150x150.png" class="attachment-thumbnail" alt="PieChart_Flat" title="PieChart_Flat" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/piechart_perspective/' title='PieChart_Perspective'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/PieChart_Perspective-150x150.png" class="attachment-thumbnail" alt="PieChart_Perspective" title="PieChart_Perspective" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/radarchart_basic/' title='RadarChart_Basic'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/RadarChart_Basic-150x150.png" class="attachment-thumbnail" alt="RadarChart_Basic" title="RadarChart_Basic" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/scatterchart_basic/' title='ScatterChart_Basic'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/ScatterChart_Basic-150x150.png" class="attachment-thumbnail" alt="ScatterChart_Basic" title="ScatterChart_Basic" /></a>
<a href='http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/vennchart_basic/' title='VennChart_Basic'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/04/VennChart_Basic-150x150.png" class="attachment-thumbnail" alt="VennChart_Basic" title="VennChart_Basic" /></a>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2011%2F04%2Fgoogle-chart-api-php-classes%2F&amp;title=Google%20Chart%20API%20PHP%20classes" id="wpa2a_8">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2011/04/google-chart-api-php-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asterisk CDR Statistics</title>
		<link>http://www.stuartford.me.uk/2011/03/asterisk-cdr-statistics/</link>
		<comments>http://www.stuartford.me.uk/2011/03/asterisk-cdr-statistics/#comments</comments>
		<pubDate>Sun, 27 Mar 2011 14:56:19 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Asterisk]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Telecommunications]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1248</guid>
		<description><![CDATA[I've been a beneficiary of the open source software community for quite some time now. Ever since downloading Slackware Linux onto upteen floppy disks in 1995, I have used and profited from the use of open source software, whether it it be an operating system, programming language, server technology or desktop application. However, up until this point [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I've been a beneficiary of the <a href="http://en.wikipedia.org/wiki/Open-source_software">open source software</a> community for quite some time now. Ever since downloading <a href="http://www.slackware.com/">Slackware Linux</a> onto upteen floppy disks in 1995, I have used and profited from the use of open source software, whether it it be an operating system, programming language, server technology or desktop application. However, up until this point I've never given anything back to the open source community (I really don't count my Twitter CLI script), chiefly because every software system I have created or worked on has been proprietary and subject to non-disclosure agreements. I'm not grumbling about that, not all software is meant to be or should be open source and working on such systems has paid the bills (just about).</p>
<p>So, what have I written? Unhappy about the lack of a decent (and free of charge) system for analysing caller detail records (CDRs) generated by <a href="http://www.asterisk.org/">Asterisk PBX</a> telephone systems, I decided that I would combine a number of techniques that I have learnt and developed over the past year or so to put my own package together, and it's now at the stage where I think it could be considered a beta. This means that it's not perfect but it's more or less there. I've started hosting it over at <a href="http://code.google.com/p/agcdr/">Google Code</a>, including a <a href="http://code.google.com/p/agcdr/downloads/list">tarball download</a> and a <a href="http://code.google.com/p/agcdr/source/browse/">Subversion repository</a>.</p>
<h3>Principal features</h3>
<ul>
<li>Clean, modern interface.</li>
<li>Supports multiple Asterisk servers which record their CDRs to a MySQL database.</li>
<li>Uses Google Chart API to generate dynamic charts.</li>
<li>Quick and advanced search facilities.</li>
<li>Rolling monthly and annual reports.</li>
<li>MVC framework*.</li>
</ul>
<h3>Screenshots</h3>

<a href='http://www.stuartford.me.uk/2011/03/asterisk-cdr-statistics/agcdr-screenshot-1/' title='agcdr-screenshot-1'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/03/agcdr-screenshot-1-150x150.png" class="attachment-thumbnail" alt="Main overview" title="agcdr-screenshot-1" /></a>
<a href='http://www.stuartford.me.uk/2011/03/asterisk-cdr-statistics/agcdr-screenshot-2/' title='agcdr-screenshot-2'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/03/agcdr-screenshot-2-150x150.png" class="attachment-thumbnail" alt="Month report" title="agcdr-screenshot-2" /></a>
<a href='http://www.stuartford.me.uk/2011/03/asterisk-cdr-statistics/agcdr-screenshot-3/' title='agcdr-screenshot-3'><img width="150" height="150" src="http://www.stuartford.me.uk/wp-content/uploads/2011/03/agcdr-screenshot-3-150x150.png" class="attachment-thumbnail" alt="Search results" title="agcdr-screenshot-3" /></a>

<h3>Further development</h3>
<p>Where does it go from here? I'm open to suggestion, which is why I've published it and I would welcome comments from anyone who's interested and/or finds it useful, whether you are a developer or just an end user. Is it useful? Does it work out of the box on your system? Is it easy to install for someone who isn't a developer? What other features would be useful, bearing in mind that the data produced by the Asterisk CDR MySQL add-on is relatively limited?</p>
<p>I know that the documentation is a little rough around the edges and so I shall be paying attention to that, certainly. I also want to do some really thorough and structured testing in order to ensure it's as robust as possible. I've tested it, obviously, but I've not seriously tried to break it yet.</p>
<p>So please feel free to download it, either as a tarball for installation or from the Subversion repository if you would like a good look under the hood. Please submit any comments, suggestions or indeed any code you would like to contribute via the Google Code page in order that all information pertaining to it is kept in the same place. I won't publish any comments made directly on this blog post for this reason.</p>
<p><em>* Incidentally, the MVC framework which AGCDR uses is also of my own creation and is something that I'm working on with a colleague from work. It's called <a href="http://code.google.com/p/syml/">Syml</a> and it's also available on <a href="http://code.google.com/p/syml/">Google Code</a> if you would like a gander at that separately.</em></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2011%2F03%2Fasterisk-cdr-statistics%2F&amp;title=Asterisk%20CDR%20Statistics" id="wpa2a_10">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2011/03/asterisk-cdr-statistics/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Command line Twitter script</title>
		<link>http://www.stuartford.me.uk/2011/01/command-line-twitter-script/</link>
		<comments>http://www.stuartford.me.uk/2011/01/command-line-twitter-script/#comments</comments>
		<pubDate>Wed, 26 Jan 2011 18:32:13 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Social networking]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1207</guid>
		<description><![CDATA[I mentioned on Twitter the other day that I have a relatively basic but functional command line Twitter script, for use when you can't or just don't want to load the full-fat Twitter site in your web browser or you don't want to use a third party GUI client. I received much more interest in [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p><a href="http://www.stuartford.me.uk/wp-content/uploads/2011/01/twitter_newbird_boxed_whiteonblue.png" rel="lightbox[1207]" title="twitter_newbird_boxed_whiteonblue"><img class="alignleft size-thumbnail wp-image-1212" title="twitter_newbird_boxed_whiteonblue" src="http://www.stuartford.me.uk/wp-content/uploads/2011/01/twitter_newbird_boxed_whiteonblue-150x150.png" alt="" width="105" height="105" /></a>I mentioned on <a href="http://twitter.com/">Twitter</a> the other day that I have a relatively basic but functional command line Twitter script, for use when you can't or just don't want to load the full-fat Twitter site in your web browser or you don't want to use a third party GUI client. I received much more interest in this than I thought I would (i.e. more than zero) and so after some thought* I've decided to <a href="/misc/downloads/code/twitter-1.010.php.gz">make it available to anyone who wants it</a>.</p>
<p>The script, which supports a single Twitter account, supports the following actions:</p>
<ul>
<li>Update (tweet), with option to specify an existing update ID to reply to.</li>
<li>Retrieve your public timeline (your tweets and those of who you follow).</li>
<li>Retrieve your own timeline.</li>
<li>Retrieve the public timeline.</li>
<li>Retrieve your recent mentions.</li>
<li>Retrieve recent re-tweets of your updates.</li>
<li>Search Twitter.</li>
</ul>
<p>In order to work, you must authorise your Twitter account with <a href="http://www.supertweet.net/">SuperTweet</a>, and provide the script with the username and secret that you specify in your SuperTweet account. This is because the script does not support oAuth (at least, not yet). Also, if you use Twitter to post URLs (and you probably do) you will also require a <a href="http://bit.ly/a/sign_up">Bit.ly API key</a>. Edit the script and provide both sets of credentials at the top.</p>
<p>The script is self contained, containing all the various classes that it depends on in the same file. I've verified that it works "out of the box" on Ubuntu Linux 10.04 and Mac OS 10.6. It will probably work on many other systems too, assuming they have PHP installed. With a small modification to the first line you can probably get it to work on Windows too, but that's as far as I can advise, you're on your own from there. The version I use doesn't contain the included classes as I link it to my local class library.</p>
<p>To get started, <strong><a href="/misc/downloads/code/twitter-1.010.php.gz">download the script</a></strong>, unpack it with <tt>gzip -d</tt>, add execute permissions with <tt>chmod +x</tt> and then type <tt>./twitter.php commands</tt> for a usage summary. Some commands when called without arguments will present further usage summaries which will tell you how to use them. You'll probably want to start with something like:</p>
<p style="padding-left: 30px;"><tt>./twitter.php update "Testing @stuartford's pitiful command line Twitter script."</tt></p>
<p>Don't forget to add your Twitter and Bit.ly credentials to the top of the script otherwise it definitely won't work first time for you and I'd rather that didn't happen.</p>
<p>If you don't understand most of this post then this script probably isn't for you, sorry, it is what it is, no warranty, etc.</p>
<p><em>* I say it required some thought because it's rare that I make my code available for public use. I don't know why, because I believe I am a talented software developer, I guess it might be the slight family creative gene within me that might be forcing a behaviour equivalent to an artist who's perpetually reluctant to show people his work, who knows, that's one for the shrink's chair. Certainly the script isn't my best work, it grew out of something quick and dirty, and as any developer will tell you, anything that grows out of something quick and dirty will always be quick and dirty at its heart.</em></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2011%2F01%2Fcommand-line-twitter-script%2F&amp;title=Command%20line%20Twitter%20script" id="wpa2a_12">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2011/01/command-line-twitter-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back in the saddle</title>
		<link>http://www.stuartford.me.uk/2010/07/back-in-the-saddle/</link>
		<comments>http://www.stuartford.me.uk/2010/07/back-in-the-saddle/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 18:57:59 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Birmingham]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1080</guid>
		<description><![CDATA[I  started my new job in Birmingham city centre (specifically, the Jewellery Quarter) on Monday, for Glide Utilities, a firm that sells household utilities (gas, electricity, telephone, broadband and TV licence) as a package to renting house-sharers, passing on a portion of the cost-savings brought about by bulk deals made with suppliers. As I mentioned [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I  started my new job in Birmingham city centre (specifically, the <a href="http://foursquare.com/venue/293529">Jewellery Quarter</a>) on Monday, for <a href="http://www.glide.uk.com/">Glide Utilities</a>, a firm that sells household utilities (gas, electricity, telephone, broadband and TV licence) as a package to renting house-sharers, passing on a portion of the cost-savings brought about by bulk deals made with suppliers.</p>
<p>As I mentioned in my previous post, instead of paying separate suppliers directly, who will insist that accounts held with them are in one name only, house-sharers all pay a fixed sum every month to Glide who then handle the rest. It makes for easy budgeting and reduces household administration which can otherwise be a bit bewildering to people who are living separately from their parents and not in university halls for the first time. Glide is currently unique in its market and by all accounts seems to be doing very well.</p>
<p>My job is, with another member of technical staff, to maintain and enhance the somewhat complex software system that runs the company, which does virtually everything from internal company administration, accounting and billing right through to live ordering and status checking of utilities from suppliers. As with any existing system being started on by a new developer I will need a suitable gear-up period, but I'm making great inroads into it and I reckon that by the end of the week I'll be able to make some initial recommendations as to procedure and future development.</p>
<p>It's really good to be doing what I do full time again. It occurred to me on Monday morning that the last time I got up in the morning to go to a full time job in an office somewhere my life was very different, better in some ways and worse in others. It's very different now, still a long way from ideal, but I do know that I'm going in the right direction to get to where I want to be. Doing what I am good at every day is a critically important step towards my goals rather than wasting time on the amount of sales and marketing that self employment demands of me, because I'm absolutely hopeless at both. I'm creative and technical, always have been, always will be.</p>
<p>I've been told to get the train in on Friday and not drive in. I can only assume that this means there's going to be some sort of new-starter party in the afternoon/evening. It's a young company and everyone who works there is around my age or younger, so I think it's a fair bet that that's what it's going to be.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2010%2F07%2Fback-in-the-saddle%2F&amp;title=Back%20in%20the%20saddle" id="wpa2a_14">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2010/07/back-in-the-saddle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gainful employment</title>
		<link>http://www.stuartford.me.uk/2010/07/gainful-employment/</link>
		<comments>http://www.stuartford.me.uk/2010/07/gainful-employment/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 18:08:54 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Birmingham]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.stuartford.me.uk/?p=1073</guid>
		<description><![CDATA[I'm delighted to report that on Monday I start a new job as a Software Engineer for a utilities management company in the Jewellery Quarter in central Birmingham. The reality of being self employed is quite different to what is perceived and I was very much struggling with the sales and marketing side of working [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p>I'm delighted to report that on Monday I start a new job as a Software Engineer for a utilities management company in the Jewellery Quarter in central Birmingham. The reality of being self employed is quite different to what is perceived and I was very much struggling with the sales and marketing side of working for myself, so I decided to move back in to full time employment in order that I may concentrate on and spend my time on what I'm actually good at rather than incur frustration at spending time on having to do things that I'm not so hot at. I've never been a salesperson and I never will be. You have to be a certain type of person to do that I'm just not that person. I'm creative and technical, always will be.</p>
<p>The company is unique in its market. It provides a service to landlords and tenants whereby all members of a shared rented household pay one fixed monthly sum for all their utilities, including gas, electricity, water, telephone and broadband. Primarily aimed at the student market where house-sharing is most common, the company uses its buying power to negotiate cheaper rates from utilities providers and passes a portion of those savings on to their customers. It's an exciting young company and I believe that I can make a difference to their operation and improve it through the ongoing enhancement of their existing software systems.</p>
<p>It's an 11 mile commute into central Birmingham every day, which is fine, it should take me around 45 minutes each way. I don't have to be in the office until 10.00am each day so that should allow me to avoid the worst of the traffic, which is ironically enough on the roads leading into and out of Sutton Coldfield rather than central Birmingham itself, once I'm past Sutton it becomes a lot easier. The equivalent train journey is less pleasant at 90 minutes in each direction including the two walks from the start and destination stations, so using the car is the way to go.</p>
<p>I'm looking forward to it.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2010%2F07%2Fgainful-employment%2F&amp;title=Gainful%20employment" id="wpa2a_16">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2010/07/gainful-employment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aptana Studio</title>
		<link>http://www.stuartford.me.uk/2009/06/aptana-studio/</link>
		<comments>http://www.stuartford.me.uk/2009/06/aptana-studio/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 15:41:09 +0000</pubDate>
		<dc:creator>Stuart Ford</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.snwo.org/?p=298</guid>
		<description><![CDATA[Up until a few months ago I used Zend Studio as my IDE (Integrated Development Environment). I'd used this for a number of years, since 2005 I believe, and the version I was using (5.5.x) was starting to show its age. Zend do have a new version but I never got on with it, largely [...]]]></description>
			<content:encoded><![CDATA[            <script type="text/javascript" src="http://www.stuartford.me.uk/wp-content/plugins/wordpress-code-snippet/scripts/shBrushPhp.js"></script>
<p><a title="Aptana Studio" href="http://www.aptana.com/"><img class="alignleft size-medium wp-image-300" title="aptana_black" src="http://www.snwo.org/wp-content/uploads/2009/06/aptana_black-300x108.png" alt="aptana_black" width="300" height="108" /></a>Up until a few months ago I used <a title="Zend Studio" href="http://www.zend.com/products/studio/">Zend Studio</a> as my IDE (Integrated Development Environment). I'd used this for a number of years, since 2005 I believe, and the version I was using (5.5.x) was starting to show its age. Zend do have a new version but I never got on with it, largely I suspect due to its <a href="http://www.eclipse.org/">Eclipse</a> underpinnings. Whilst Zend Studio 5 was dedicated to PHP, Zend Studio 6 seemed little more than a plugin for a different IDE that was more geared towards Java developers, and it just didn't work for me. The price didn't work for me either, at €399.</p>
<p>Then along came Aptana. which I stumbled across whilst doing some research into<a href="http://www.adobe.com/products/air/"> Adobe Air</a> (which came to nothing, incidentally, I'm not going to bother with it). Apatana takes all the good bits of Eclipse, adds to them and packages them up into an IDE that's aimed at web developers <em>in general</em>, whether your poison is PHP, Python, Ruby or whatever else. It's <strong>aware</strong> that the software you're developing is web software, and so knows about things like CSS, Javascript, Javascript libraries, XML, JSON and so forth. It just feels like it's geared towards <em>you</em> as a <em>web developer</em>, rather than a generic software developer, which is how Eclipse makes you feel.</p>
<p>Aptana is brimming with features, too numerous to list here. Suffice to say that, if you are familiar with modern IDEs, all your bases are covered and then some. For those who don't use an IDE I would suggest Aptana as a good starting point in the IDE world because of what I mentioned before about it not being completely generic.</p>
<p>It has its shortcomings, as any piece of software does. My biggest gripe is that it's written in Java, which brings along all the usual problems associated with software written in Java, i.e. large memory footprint, high CPU usage, messy crashing, etc. That said I appreciate that Java has allowed Aptana to be cross-platform, thus reducing development costs and, ultimately, keeping its price tag at a very reasonable $99. It's certainly the best $99 that I will spend this year.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.stuartford.me.uk%2F2009%2F06%2Faptana-studio%2F&amp;title=Aptana%20Studio" id="wpa2a_18">Share on Facebook, Twitter and goodness knows what else</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.stuartford.me.uk/2009/06/aptana-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

