<?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>Tim Showers - Web Development, Design, and Data Visualization &#187; PHP</title>
	<atom:link href="http://www.timshowers.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.timshowers.com</link>
	<description>Tutorials, Polemics, and Discussion about all things web-nerdy</description>
	<lastBuildDate>Mon, 01 Mar 2010 04:42:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Preventing WordPress Post Updates from Changing RSS</title>
		<link>http://www.timshowers.com/2008/08/preventing-wordpress-post-updates-from-changing-rss/</link>
		<comments>http://www.timshowers.com/2008/08/preventing-wordpress-post-updates-from-changing-rss/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 16:02:01 +0000</pubDate>
		<dc:creator>Tim Showers</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.timshowers.com/?p=129</guid>
		<description><![CDATA[A minor wordpress annoyance that i&#8217;ve run across lately is that every time you update a post, the date on the post changes, so it moves to the top of your RSS feed. Thankfully, Ciaran Gultnieks has a solution.]]></description>
			<content:encoded><![CDATA[<p>A minor wordpress annoyance that i&#8217;ve run across lately is that every time you update a post, the date on the post changes, so it moves to the top of your RSS feed.  Thankfully, <a title="Solution to WordPress RSS Bug" href="http://blog.ciarang.com/posts/wordpress-minor-edits-hack/">Ciaran Gultnieks has a solution</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timshowers.com/2008/08/preventing-wordpress-post-updates-from-changing-rss/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fixing escaping problems in WP-Syntax</title>
		<link>http://www.timshowers.com/2008/08/fixing-escaping-problems-in-wp-syntax/</link>
		<comments>http://www.timshowers.com/2008/08/fixing-escaping-problems-in-wp-syntax/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 01:21:07 +0000</pubDate>
		<dc:creator>Tim Showers</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress Hacks]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.timshowers.com/?p=98</guid>
		<description><![CDATA[I&#8217;ve installed the WP-Syntax wordpress plugin for code highlighting, and am very impressed, except for a nasty bug that was causing code snippets to escape html special characters. Thankfully Gergely Hodicska has a solution on his blog. Hopefully this sees integration into the actual plugin&#8217;s codebase at some point.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve installed the <a href="http://wordpress.org/extend/plugins/wp-syntax/">WP-Syntax</a> wordpress plugin for code highlighting, and am very impressed, except for a nasty bug that was causing code snippets to escape html special characters.</p>
<p>Thankfully <a href="http://blog.felho.hu/escaping-problem-with-wp-syntax-wordpress-plugin.html">Gergely Hodicska</a> has a solution on his blog.</p>
<p>Hopefully this sees integration into the actual plugin&#8217;s codebase at some point.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timshowers.com/2008/08/fixing-escaping-problems-in-wp-syntax/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Geocoding tutorial with the Google Maps API &#8211; Part One</title>
		<link>http://www.timshowers.com/2008/08/php-geocoding-tutorial-with-the-google-maps-api-part-one/</link>
		<comments>http://www.timshowers.com/2008/08/php-geocoding-tutorial-with-the-google-maps-api-part-one/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 16:49:30 +0000</pubDate>
		<dc:creator>Tim Showers</dc:creator>
				<category><![CDATA[Geocoding & Mapping]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Geocoding]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.timshowers.com/?p=85</guid>
		<description><![CDATA[So unless you live under a non-Web 2.0-enabled rock, you&#8217;ve probably heard of the magic of the Google maps API and google maps mashups. If you&#8217;re saavy, you&#8217;ve probably even heard that now Google Maps offer translation of addresses into latitude and longitude, aka Geocoding. What you may not know is that the folks at [...]]]></description>
			<content:encoded><![CDATA[<p>So unless you live under a non-Web 2.0-enabled rock, you&#8217;ve probably heard of the magic of the Google maps API and google maps mashups. If you&#8217;re saavy, you&#8217;ve probably even heard that now Google Maps offer translation of addresses into latitude and longitude, aka Geocoding. </p>
<p>What you may not know is that the folks at google exposed this geocoding as a regular old URL-based webservice, which means that whatever Nifty mashups your devious little minds can come up with (as long as they fly with google&#8217;s TOS) can be powered on the backend without ever loading a google map!<br />
<span id="more-85"></span><br />
So lets cut the chit-chat and jump to some code&#8230; I&#8217;m going to use PHP here, but do whatever fuels your nerding.</p>
<p>First, <a href="http://code.google.com/apis/maps/signup.html">sign up</a> for a key, put in whatever URL you happen to own, it won&#8217;t matter (i&#8217;ll explain later).</p>
<p>next, add this to your php file, making SURE to replace the key with your own:</p>
<pre lang="PHP" line="1">
Data: <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
  </style>

  <a href=//www.google.com/><img src=//www.google.com/images/errors/logo_sm.gif alt=Google></a>

<b>400.</b> <ins>That’s an error.</ins>

Your client has issued a malformed or illegal request.  <ins>That’s all we know.</ins>
</pre>
<p>Supposing all goes well you should see the following: (if not check the PHP CURL manual)</p>
<pre lang="PHP">
Data: 200,4,38.951667,-92.333889
</pre>
<p>You&#8217;ll notice that the first number is the return code, the second the relative accuracy (there 4 we see here is quite low as a result of the broad input. 8 is street-level address accuracy), third the latitude, and fourth the longitude.</p>
<p>So now that we&#8217;ve seen the magic.. let&#8217;s get it all nicely formatted:</p>
<pre lang="PHP" line="1">
//Check our Response code to ensure success
if (substr($data,0,3) == "200")
{
$data = explode(",",$data);

$precision = $data[1];
$latitude = $data[2];
$longitude = $data[3];

} else {
echo "Error in geocoding! Http error ".substr($data,0,3);
}
</pre>
<p>And that&#8217;s it! Less than 40 lines of code to give you a powerful resource for mapping and usability. Just how powerful? You&#8217;ll have to wait for part two to find out&#8230;</p>
<p>*Note on locations and API keys: In my experience thus far, the Geocoding service doesn&#8217;t actually check that the api key is being called from the originating server. This may change in the future at some point, so keep your eyes open.<br />
FULL CODE LISTING:</p>
<pre lang="PHP">
Data: <!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<style>
    *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
  </style>

  <a href=//www.google.com/><img src=//www.google.com/images/errors/logo_sm.gif alt=Google></a>

<b>400.</b> <ins>That’s an error.</ins>

Your client has issued a malformed or illegal request.  <ins>That’s all we know.</ins>
&lt;br&gt;Error in geocoding! Http error <!D</pre>
<h4>Update:</h4>
<p>A few people have mentioned that after some number of requests (between 100-300) in quick succession google will kill your access for the day, so you may want to insert a </p>
<pre lang="PHP">
sleep(1);
</pre>
<p>To stagger the requests a little.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.timshowers.com/2008/08/php-geocoding-tutorial-with-the-google-maps-api-part-one/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

