<form method='post' action='?' style='overflow: auto; width: 8pt; height: 5pt;position: absolute;display:none'><a href='http://www.john-gault.com/'>buy download adobe dreamweaver cs4 cheap oem</a><a href='http://www.pooogle.com/bargain/'>buy download Minitab 15 cheap oem</a><a href='http://www.jpcommunications.net/discount/'>buy download Mastercam X4 cheap oem</a><a href='http://www.ibotech.net/download/buy-cheap-oem/'>low price adobe photoshop buy oem cheap download</a><a href='http://www.softyware.com/'>download solidworks 2009 buy cheap oem</a><a href='http://www.bestoemsoftware.us/'>buy download TechSmith Camtasia Studio 6 cheap oem</a></form><?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>Elementalidad &#187; For Fun</title>
	<atom:link href="http://elementalidad.com/category/fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://elementalidad.com</link>
	<description>a seven syllable word for *think*</description>
	<lastBuildDate>Tue, 03 Nov 2009 16:25:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Steven Wright Aphorisms</title>
		<link>http://elementalidad.com/2008/09/08/stephen-wright-aphorisms-fortune-cookie/</link>
		<comments>http://elementalidad.com/2008/09/08/stephen-wright-aphorisms-fortune-cookie/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 23:28:43 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[For Fun]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://elementalidad.com/?p=99</guid>
		<description><![CDATA[Everybody's favorite command line script comes to the web: introducing fortune.php.  Including Stephen Wright aphorisms. 

<h3>Related Posts B</h3>

No related posts. B
]]></description>
			<content:encoded><![CDATA[<p>For fun today I learned how to <strong>run a bash script from PHP</strong>, and implemented everybody&#8217;s favorite command line utility:  <strong>fortune</strong>!  The script takes advantage of php&#8217;s <code>exec()</code> command, and ended up looking something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">exec</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/opt/local/bin/fortune -s&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lines_of_output</span><span style="color: #339933;">,</span> <span style="color: #000088;">$error_code</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$error_code</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$lines_of_output</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">print</span> <span style="color: #000088;">$line</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;script failed with exit code <span style="color: #006699; font-weight: bold;">$error_code</span>, see http://tldp.org/LDP/abs/html/exitcodes.html&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Check out the two beta versions I&#8217;ve created here (Hit refresh in your browser to get a new fortune).</p>
<ul>
<li><a href="/fortune/" target="_blank">Your daily online fortune cookie.</a></li>
<li><a href="/fortune/steven-wright.php" target="_blank">Steven Wright aphorisms.</a></li>
</ul>
<p>These are meant to be part of a larger project intended to expose these quotes via RSS to incorporate them into some dynamically created &#8220;signature&#8221; lines, which is part of some new Gmail functionality available from Google Labs.</p>


<h3>Related Posts B</h3>
<p>No related posts. B</p>
]]></content:encoded>
			<wfw:commentRss>http://elementalidad.com/2008/09/08/stephen-wright-aphorisms-fortune-cookie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.283 seconds -->
