{"id":130,"date":"2008-04-09T22:47:35","date_gmt":"2008-04-10T05:47:35","guid":{"rendered":"http:\/\/www.bigroom.org\/wordpress\/?p=130"},"modified":"2008-04-09T22:47:35","modified_gmt":"2008-04-10T05:47:35","slug":"well-a-php-example-anyway","status":"publish","type":"post","link":"https:\/\/www.bigroom.org\/wordpress\/?p=130","title":{"rendered":"Well, a PHP example, anyway"},"content":{"rendered":"<p>Once I dove in and started messing around, I only had to fix two typos as the example I was working on seems to work correctly, at least to the extent that I&#8217;ve tested it.  I now have what appears to be a working example of <a title=\"Geotagging arbitrary data\" href=\"http:\/\/www.bigroom.org\/?page_id=110\">Geostring<\/a> parsing in PHP.  In this case, the example reads <a title=\"Epicanis' Twitter Page on the Web\" href=\"http:\/\/www.twitter.com\/Epicanis\">my feed from the Twitter website<\/a>, sifts out any geostring tags it finds, then generates Google Maps links for each one found.  As I write this, there are two geostring tags on that page, representing places (and times)<br \/>\nthat I have actually been, and it seems to work.<\/p>\n<p>You can take a look at the source code for the example <a title=\"Geostring parsing example: PHP source\" href=\"http:\/\/www.bigroom.org\/geostr_example.phps\" target=\"_other\">here<\/a>, or see it in action <a title=\"Geostrings found on Epicanis' current Twitter feed\" href=\"http:\/\/www.bigroom.org\/geostr_example.php\" target=\"_other\">here<\/a>.<\/p>\n<p>Feel free to grab a copy to play with if you&#8217;d like (or write one yourself that isn&#8217;t so messy &#8211; hey, as someone who doesn&#8217;t consider himself a professional &#8220;coder&#8221;, I&#8217;m just happy that it did exactly what I wanted it to do on the first try&#8230;).  You should only need to worry about two things &#8211; changing the $text_to_read, and whether or not your web server (or <span class=\"moreinfo\" title=\"Command Line Interface - yes, PHP is good for shell scripts, too\" onclick=\"alert(this.title);\">CLI<\/span>) has fopen wrappers turned on so the script can read another web page if you use a web page as your text to parse rather than a local file.<\/p>\n<p>Since <em>generating<\/em> a geostring tag is trivial, I didn&#8217;t bother trying to incorporate that into this example.  If you want one, then here:<\/p>\n<blockquote><p>&lt;?php<br \/>\n\/\/generate a geostr tag with the most typical information only<br \/>\n\/\/point not part of a track nor including heading or angle<br \/>\n$lat=44.027168;<br \/>\n$lon=-111.297892;<br \/>\n$elev=&#8221;1711.9m&#8221;; \/\/could leave off the &#8220;m&#8221; and treat as float, since it defaults to &#8220;meters&#8221;<br \/>\n$timestamp=&#8221;20071125T123438-06&#8243;; \/\/6 hours behind UTC<\/p>\n<p>print(&#8220;geostr:$lat,$lon,$elev:$timestamp:geostr&#8221;);<br \/>\n\/\/&#8221;full&#8221; version: print(&#8220;geostr:$lat,$lon,$elev:$timestamp,:,:geostr&#8221;);<br \/>\n\/\/completely unnecessary, but legal<br \/>\n?&gt;<\/p><\/blockquote>\n<p>As always, comments and suggestions are welcome.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once I dove in and started messing around, I only had to fix two typos as the example I was working on seems to work correctly, at least to the extent that I&#8217;ve tested it. I now have what appears to be a working example of Geostring parsing in PHP. In this case, the example &hellip; <a href=\"https:\/\/www.bigroom.org\/wordpress\/?p=130\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Well, a PHP example, anyway<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,4,13,12,15,40,33],"tags":[108,44,55,107,110,105,82,578,106,101,54,109],"class_list":["post-130","post","type-post","status-publish","format-standard","hentry","category-computer-nerdity","category-feedback-solicitation","category-me-me-me","category-meta-blogging","category-methods","category-neogeography","category-the-big-room","tag-beaches","tag-brewing","tag-colorado","tag-examples","tag-fossil-butte","tag-geostrings","tag-geotagging","tag-neogeography","tag-php","tag-programming","tag-texas","tag-wyoming"],"_links":{"self":[{"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/130","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=130"}],"version-history":[{"count":0,"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bigroom.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}