<?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>Patrick Blogs for Curious People &#187; data</title>
	<atom:link href="http://patrickbarry.com/blog/tag/data/feed" rel="self" type="application/rss+xml" />
	<link>http://patrickbarry.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 06 Apr 2014 23:32:38 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.8.41</generator>
	<item>
		<title>Beer mapping done better</title>
		<link>http://patrickbarry.com/blog/beer-mapping-done-better</link>
		<comments>http://patrickbarry.com/blog/beer-mapping-done-better#comments</comments>
		<pubDate>Sun, 06 Apr 2014 23:24:14 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beer]]></category>
		<category><![CDATA[data]]></category>

		<guid isPermaLink="false">http://patrickbarry.com/blog/?p=87</guid>
		<description><![CDATA[I&#8217;ve long wished for a better tool than beermapping.com for planning visits to new cities and making sure to hit a couple of the best bars, restaurants, and stores for beer. Of course, it doesn&#8217;t care about making any actual &#8230; <a href="http://patrickbarry.com/blog/beer-mapping-done-better">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve long wished for a better tool than <a href="http://beermapping.com/">beermapping.com</a> for planning visits to new cities and making sure to hit a couple of the best bars, restaurants, and stores for beer. Of course, it doesn&#8217;t care about making any actual recommendations, just listing *everything*:</p>
<p><a href="http://patrickbarry.com/blog/wp-content/uploads/2014/04/beermapping.png"><img class="alignnone size-large wp-image-89" title="BeerMapping chicago screenshot" alt="" src="http://patrickbarry.com/blog/wp-content/uploads/2014/04/beermapping-1024x700.png" width="640" height="437" /></a></p>
<p>For recommendations that are usable for planning a trip, I&#8217;ve always used the <a href="http://www.beeradvocate.com/place/directory/0/US/">BeerAdvocate city directories</a>, which (if you pay close attention), list the bars, stores, etc in order of ratings. But to properly plan a trip, you need a map, and these guides fall far short.</p>
<p>As a first step towards fixing this, I used a series of tools to make transforming a city&#8217;s BeerAdvocate guide into a map less painful. Maybe I&#8217;m biased from working on it recently, but I put the final map into <a href="http://mapsengine.google.com">Google MapsEngine</a>. Here&#8217;s <a href="https://mapsengine.google.com/map/edit?mid=zi5YYvpk3nzg.k4t-jSNFyWF8">my final beer map for Chicago</a>:</p>
<p><a href="https://mapsengine.google.com/map/edit?mid=zi5YYvpk3nzg.k4t-jSNFyWF8"><img class="alignnone size-full wp-image-100" title="my Chicago beer map screenshot" alt="" src="http://patrickbarry.com/blog/wp-content/uploads/2014/04/Screen-Shot-2014-04-06-at-4.20.37-PM.png" width="2178" height="1432" /></a></p>
<p>Detail shot:</p>
<p><a href="https://mapsengine.google.com/map/edit?mid=zi5YYvpk3nzg.k4t-jSNFyWF8"><img class="alignnone size-large wp-image-90" title="Example from my new Chicago beer map" alt="" src="http://patrickbarry.com/blog/wp-content/uploads/2014/04/chicago_map-1024x748.png" width="640" height="467" /></a></p>
<p>The map has 2 groups &#8211; blue markers for bars/eateries (my biggest wish would be for BeerAdvocate to separate those&#8230;) and green markers for bottle stores. Darker icons have higher scores.</p>
<p>Here&#8217;s the semi-manual process I used to generate this map in less than a half hour:</p>
<ol>
<li>Open the BeerAdvocate city guide you want, in my case, <a href="http://www.beeradvocate.com/place/city/6/">Chicago</a>.</li>
<li>Install the <a href="http://www.kimonolabs.com/">Kimono</a> bookmarklet, which will give you a tool to automate the conversion of lists on websites into data feeds (most importantly here, CSV format).</li>
<li>After going through the Kimono tutorial, you should be able to make something like <a href="http://www.kimonolabs.com/apis/2nz3qsvc">my API</a> &#8211; both name and address for the 2 different sections (bars/eateries and bottle stores).<br />
<a href="http://patrickbarry.com/blog/wp-content/uploads/2014/04/Screen-Shot-2014-04-06-at-3.51.37-PM.png"><img class="alignnone size-large wp-image-91" title="chicago beer API kimono collections" alt="" src="http://patrickbarry.com/blog/wp-content/uploads/2014/04/Screen-Shot-2014-04-06-at-3.51.37-PM-1024x526.png" width="640" height="328" /><br />
</a>(one caveat: I had to go into the advanced mode here and tweak the regular expressions to ignore the &#8221; &#8211; &#8221; prefix that the addresses have by default.)</li>
<li>Save this API to Kimono, then grab the CSV export, it should look something like <a href="http://patrickbarry.com/blog/wp-content/uploads/2014/04/Screen-Shot-2014-04-06-at-3.59.12-PM1.png">mine</a>.</li>
<li>Copy and paste the 2 different sections into 2 different CSV files on your computer, then open them as 2 spreadsheets in a tool that will let you fetch content from the web. I used Google Spreadsheets because I&#8217;ve used its ImportXml function before.</li>
<li>Taking the bottle stores list for example, <a href="https://docs.google.com/spreadsheet/ccc?key=0ArWmogNy9CDZdEI2UjZ6TjJDWktKTVFWRmdCYWIxUkE&amp;usp=sharing">this is the Google Spreadsheet</a> that I made. Note that I added a new column &#8220;Score&#8221; that I populated with:
<pre>=ImportXML(A2, "//span[@class='BAscore_big']")<span style="color: #222222; font-family: 'Courier 10 Pitch', Courier, monospace; line-height: 21px;"> </span></pre>
</li>
<li>If you want to only map places with scores above a certain value, you can delete those rows now.</li>
<li>Then you can import your spreadsheet into a new <a href="http://mapsengine.google.com">Google MapsEngine</a> map. I styled <a href="https://mapsengine.google.com/map/edit?mid=zi5YYvpk3nzg.k4t-jSNFyWF8">mine</a> by Score, using ranges to automatically assign darker colors to higher numbers. Beware: &#8220;100&#8243; sorts below &#8220;90&#8243; because it uses alphabetic sorting &#8211; I changed my 100s into 99s in the built-in data editor to work around this. As a final note, there were some weird artifacts from the import like <a href="http://patrickbarry.com/blog/wp-content/uploads/2014/04/Screen-Shot-2014-04-06-at-4.09.46-PM.png">duplicate incomplete rows and [#] annotations</a>, but hopefully the MapsEngine folks will fix those &#8211; they&#8217;re good people.</li>
</ol>
<p>This is still a pretty manual process, and I might come back to this in the future and use <a href="http://doc.scrapy.org/en/latest/intro/overview.html">python</a> or <a href="http://maxogden.com/scraping-with-node.html">javascript/node</a> to build an all-in-one tool that anyone can go to in order to request a map for a city (and I know I&#8217;m <a href="https://www.npmjs.org/package/beer-advocate-api">not the only one</a> thinking about this), but this scratches my itch in the short term. Maybe BeerAdvocate will decide to launch an API, or RateBeer will <a href="http://www.ratebeer.com/json/ratebeer-api.asp">re-enable theirs</a>. Who knows?</p>
<p>Hopefully this will help some other beer adventurers for now, also.</p>
]]></content:encoded>
			<wfw:commentRss>http://patrickbarry.com/blog/beer-mapping-done-better/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
