<?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>Carbon Silk &#187; php</title>
	<atom:link href="http://www.carbonsilk.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonsilk.com</link>
	<description>Developing Ideas by James Broad</description>
	<lastBuildDate>Thu, 13 May 2010 05:17:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using YQL with PHP</title>
		<link>http://www.carbonsilk.com/development/using-yql-with-php/</link>
		<comments>http://www.carbonsilk.com/development/using-yql-with-php/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 23:18:35 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[webservices]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=70</guid>
		<description><![CDATA[After presenting on PHP, OAuth and Web Services (4th February 2009) it became apparent that the main killer technology was YQL. YQL for those unfamiliar with the acronym is Yahoo Query Language, a SQL like syntax that will let you query a whole host of data sources as if it were a database table. Is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yql/"><img src="http://l.yimg.com/a/i/us/pps/yql128.gif" alt="YQL Logo" /></a>After presenting on <a href="http://www.slideshare.net/kulor/php-oauth-web-services-and-yql">PHP, OAuth and Web Services</a> (4th February 2009) it became apparent that the main killer technology was <a href="http://developer.yahoo.com/yql/"><acronym title="Yahoo Query Language">YQL</acronym></a>. YQL for those unfamiliar with the acronym is Yahoo Query Language, a <acronym title="Simple Query Language">SQL</acronym> like syntax that will let you query a whole host of data sources as if it were a database table.</p>
<p>Is YQL relevant to you? Well if you do any work with web services then definitely, it allows you to pull in multiple data sources, sort, transform, query your data points, to name but a few selling points. It will still be relevant to you if you are familiar with the SQL syntax, as it is actually really fun to play with <a href="http://developer.yahoo.com/yql/console/">using the console</a>, especially if you take the provided example queries as a jump off point to tinker with. To demonstrate how easy we can make things, take a look at this <a href="http://carbonsilk.com/yql_php/yql/search_yahoo/yql">example of a search query</a> using <a href="http://github.com/kulor/yql_php/blob/da559e966663a519f436d0aa9944212582806b98/system/application/controllers/yql.php#L65">this code</a>.</p>
<p>YQL is now becoming even more powerful with a feature called &#8216;Open Tables&#8217; which in essence instructs YQL on how to construct a web service URL. The power of this is that it enables you to interject values from other web service calls via sub selects. Some examples of Open Table definitions and <a href="http://github.com/spullara/yql-tables/blob/dea6b29ff0cd01e06fbaf84b821abf6783138b52/alltables.env">example queries</a> are being constructed at <a href="http://github.com/spullara/yql-tables/">github.com/spullara/yql-tables</a>.</p>
<p>During my talk I demonstrated a lot of the PHP code used to consume the results of the YQL calls which can be found over on <a href="http://github.com/kulor/yql_php/tree/master">my GitHub repository</a> or you can browse my example scripts at <a href="http://carbonsilk.com/yql_php/">http://carbonsilk.com/yql_php/</a>.</p>
<p>To make development in PHP straightforward I used CodeIgniter for it&#8217;s MVC strengths and ease of installation. The beauty of using the framework with YQL and OAuth libraries doing the hard work behind the scenes is that you can write a few simple lines like the following to retrieve instant results:</p>
<pre name="code" class="php">
// Controller method to allow us to access http://someurl.tld/yql_php/search_wikipedia/
function search_wikipedia($term = 'open')
{
    echo '&lt;pre&gt;';
    $yql_query = 'select * from xml where
            url="http://en.wikipedia.org/w/api.php?action=opensearch&amp;search=' . $term . '&amp;format=xml"
            and itemPath = "SearchSuggestion.Section.Item"';
    print_r($this-&gt;yql_lib-&gt;query($yql_query));
}</pre>
<p>The above code is the same query as could be found if you <a href="http://developer.yahoo.com/yql/console/?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fen.wikipedia.org%2Fw%2Fapi.php%3Faction%3Dopensearch%26search%3Dyahoo%26format%3Dxml%22%20and%20itemPath%20%3D%20%22SearchSuggestion.Section.Item%22">view in the provided console</a> or view in my final project <a href="http://carbonsilk.com/yql_php/yql/search_wikipedia/open">Search Wikipedia through YQL</a>.</p>
<p>All I can say from doing this talk and looking deep into YQL is that there is a huge potential at our disposal here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/using-yql-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to monitor your site status</title>
		<link>http://www.carbonsilk.com/development/monitor-your-site-status/</link>
		<comments>http://www.carbonsilk.com/development/monitor-your-site-status/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 17:36:26 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[siteup]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=44</guid>
		<description><![CDATA[If you are running and administering your own website, the chances are that your reputation relies on you having a stable site, or at least one that your users can reach. The problem is; how often do you check your site is up and running or how you expect it to look? Probably not often. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://flickr.com/photos/petecarr/475437514/"><img src="http://farm1.static.flickr.com/219/475437514_1565355424_m.jpg" alt="Traffic Lights" /></a>If you are running and administering your own website, the chances are that your reputation relies on you having a stable site, or at least one that your users can reach. The problem is; how often do you check your site is up and running or how you expect it to look? Probably not often.</p>
<p class="clear">I have produced a simple script that will let you check your sites are up and running.</p>
<p>The PHP script is hosted on GitHub at <a href="http://github.com/kulor/siteup/tree/master">http://github.com/kulor/siteup/tree/master</a>. You can see the output at <a href="http://carbonsilk.com/sandbox/siteup/">http://carbonsilk.com/sandbox/siteup/</a></p>
<p>To get this script running, you will need to change some of the defaults found in <a href="http://github.com/kulor/siteup/tree/master/index.php">index.php</a> and place both the files in a web accessible directory on your server</p>
<h3>Automating the script</h3>
<p>The best application of this script would be to deploy on your server (<strong>not on the server you are checking is up</strong>) and run on a <a href="http://en.wikipedia.org/wiki/Cron">crontab</a> at a fairly liberal interval (2 hours) to save server overload. To do this:</p>
<p>On your command line:<br />
<code>$ crontab -e</code></p>
<p>This will take you into an editor window. Enter the line below <strong>replacing {$path} with the location of your script</strong><br />
<code>0       */2     *     *     *   php -q /{$path}/siteup/index.php</code></p>
<p>Now you will receive an email if any of your programmed domains are down.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/monitor-your-site-status/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Moneyio &#8211; The best salary calculator ever!</title>
		<link>http://www.carbonsilk.com/development/moneyio-released/</link>
		<comments>http://www.carbonsilk.com/development/moneyio-released/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 10:07:30 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[moneyio]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[salary]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=30</guid>
		<description><![CDATA[On Monday (27 July 08) Moneyio (Money In &#38; Out) was released. Moneyio is the latest incarnation of my previous project Salary Calculator. Moneyio will be organically developed to include new relevant features with a strict focus on surfacing information on your money. The overall objective is to offer a best in class web based [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.moneyio.co.uk"><img src="http://farm4.static.flickr.com/3264/2721426271_6420438665.jpg" alt="Moneyio.co.uk Screenshot" /></a></p>
<p class="clear">On Monday (27 July 08) <a href="http://www.moneyio.co.uk">Moneyio</a> (Money In &amp; Out) was released. Moneyio is the latest incarnation of my previous project <a href="http://www.carbonsilk.com/efficiency/salary-calculator/">Salary Calculator</a>.</p>
<p>Moneyio will be organically developed to include new relevant features with a strict focus on surfacing information on your money. The overall objective is to offer a best in class web based personal finance tool, suitable for everyone.</p>
<p>Ok so you get what it is, how it works but what value does it give to you? The intention is that it can save you money. If that is through exposing where you could tighten up your expenses or offering you unobtrusive suggestions as to how you could make savings, then you can be satisfied.</p>
<p>Design is (and will be) a critical factor in development of this application as there are a whole wealth of existing tools on the web to do with personal finance, however they always fail to offer any pleasing aesthetics.</p>
<h3>Advertising</h3>
<p>This tool has taken a long time to develop, and thus i have, for the first time, gone down the commercial route of adding advertising to try and benefit from this effort. This is a conscious decision that i feel should actually benefit users on the whole, owing to the smart, context aware, targeted adverts that appear. Should users find the adverts intrusive, i will not hesitate to remove or rethink the overall commercial strategy.</p>
<h3>High performance</h3>
<p>The inner workings behind the interface are pretty intricate. Take this and add that it is a completely dynamic application, it is hard to find components available to cache effectively. Inroads will be made with future development to ensure the experience of using the application is not hampered by having to wait for actions to be completed.</p>
<p>Elements that will be performance enhanced will be caching data calculations, but more significantly, the <acronym title="Hyper Text Markup Language">HTML</acronym> and associated assets delivered to your browser.</p>
<h3>Under the hood</h3>
<p>I am proud to say Moneyio has been ported to use <a href="http://codeigniter.com/">CodeIgniter</a>. Originally the code-base took the form of a self rolled <acronym title="Pre Hypertext Preprocessor">PHP</acronym> <acronym title="Model View Controller"><a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a></acronym> application, well organised, lean and efficient code but lacking some features and maybe not as rigid as an open source framework.</p>
<p>A framework was a crucial requirement in ensuring that the application development could easily continue if say another developer had to maintain/own/extend the code-base.</p>
<p>CodeIgniter was chosen over other popular frameworks such as the <a href="http://framework.zend.com/">ZendFramework</a>, <a href="http://cakephp.org/">CakePHP</a> or the now prevalent <a href="http://www.python.org/">Python</a> framework <a href="http://www.djangoproject.com/">Django</a>, as it was somewhat familiar, possesses great documentation.</p>
<p>My experience so far has been great with working off this framework. Getting anything done becomes very trivial and a rewarding experience to boon.</p>
<p>Front end wise, <a href="http://developer.yahoo.com/yui/">Yahoo YUI</a> has been used as the tool of choice for developing in JavaScript and using their fabulous CSS tools, <a href="http://code.google.com/apis/chart/">Google Charts</a> has been used for charting and the fantastic <a href="http://www.famfamfam.com/archive/silk-icons-thats-your-lot/">Fam Fam Fam silk icons</a> have been used for UI actions.</p>
<p>I can only hope that you take a look at <a href="http://www.moneyio.co.uk">Moneyio</a>, if you like it, <a href="http://delicious.com/save?url=http://www.moneyio.co.uk&amp;title=Moneyio - Breaking Down Your Money">bookmark</a> it and return in a few weeks/months and see the latest changes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/moneyio-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
