<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Jq on traviscj/blog</title>
    <link>https://traviscj.com/blog/tags/jq/</link>
    <description>Recent content in Jq on traviscj/blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 24 Apr 2018 16:29:39 +0000</lastBuildDate>
    <atom:link href="https://traviscj.com/blog/tags/jq/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>sfpark api</title>
      <link>https://traviscj.com/blog/post/2018-04-24-sfpark-api/</link>
      <pubDate>Tue, 24 Apr 2018 16:29:39 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2018-04-24-sfpark-api/</guid>
      <description>&lt;p&gt;I recently came to learn of the &lt;a href=&#34;http://sfpark.org/wp-content/uploads/2013/12/SFpark_API_Dec2013.pdf&#34;&gt;SFpark API&lt;/a&gt;, which lets one make queries like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;LAT=37.787702&#xA;LONG=-122.407796&#xA;curl &amp;quot;http://api.sfpark.org/sfpark/rest/availabilityservice?lat=${LAT}&amp;amp;long=${LONG}&amp;amp;radius=0.25&amp;amp;uom=mile&amp;amp;response=json&amp;quot; | pbcopy&#xA;pbpaste | jq &#39;.AVL[] | select (.TYPE | contains(&amp;quot;OFF&amp;quot;))&#39;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;and get a response including records like:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;{&#xA;  &amp;quot;TYPE&amp;quot;: &amp;quot;OFF&amp;quot;,&#xA;  &amp;quot;OSPID&amp;quot;: &amp;quot;950&amp;quot;,&#xA;  &amp;quot;NAME&amp;quot;: &amp;quot;Union Square Garage&amp;quot;,&#xA;  &amp;quot;DESC&amp;quot;: &amp;quot;333 Post Street&amp;quot;,&#xA;  &amp;quot;INTER&amp;quot;: &amp;quot;Geary between Stockton &amp;amp; Powell&amp;quot;,&#xA;  &amp;quot;TEL&amp;quot;: &amp;quot;(415) 397-0631&amp;quot;,&#xA;  &amp;quot;OPHRS&amp;quot;: {&#xA;    &amp;quot;OPS&amp;quot;: {&#xA;      &amp;quot;FROM&amp;quot;: &amp;quot;7 Days/Wk&amp;quot;,&#xA;      &amp;quot;BEG&amp;quot;: &amp;quot;24 Hrs/Day&amp;quot;&#xA;    }&#xA;  },&#xA;  &amp;quot;OCC&amp;quot;: &amp;quot;381&amp;quot;,&#xA;  &amp;quot;OPER&amp;quot;: &amp;quot;670&amp;quot;,&#xA;  &amp;quot;PTS&amp;quot;: &amp;quot;1&amp;quot;,&#xA;  &amp;quot;LOC&amp;quot;: &amp;quot;-122.407447946,37.7876789151&amp;quot;&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Pretty cool!&lt;/p&gt;</description>
    </item>
    <item>
      <title>toy/life data models</title>
      <link>https://traviscj.com/blog/post/2017-04-19-toy_life_data_models/</link>
      <pubDate>Wed, 19 Apr 2017 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2017-04-19-toy_life_data_models/</guid>
      <description>&lt;p&gt;I&amp;rsquo;ve been experimenting a lot with some kinda &amp;ldquo;toy&amp;rdquo; data models based on random things that I wish there was a database to query, but isn&amp;rsquo;t.&#xA;For example:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;What was my average arrival time this week?&lt;/li&gt;&#xA;&lt;li&gt;How much of my equity has vested before a certain date?&lt;/li&gt;&#xA;&lt;li&gt;When was the last time we had spaghetti for dinner?&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;I&amp;rsquo;ve been doing this with flat JSON files.&#xA;This is a bit of an odd choice for me; I actually love schematizing data models in protobuf and MySQL and designing proper indices for the data models I work on during work hours.&lt;/p&gt;</description>
    </item>
    <item>
      <title>build_json.sh</title>
      <link>https://traviscj.com/blog/post/2015-08-19-build_json.sh/</link>
      <pubDate>Wed, 19 Aug 2015 00:00:00 +0000</pubDate>
      <guid>https://traviscj.com/blog/post/2015-08-19-build_json.sh/</guid>
      <description>&lt;p&gt;This might seem silly, but I&amp;rsquo;ve beeing playing with some&#xA;&lt;a href=&#34;http://traviscj.com/ZeroBin/?1d4c5e66662c6306#V91+G7w0NYxN4ui/sDPBivPA8Fo5PzB7mZHAPboau7U=&#34;&gt;json.sh&lt;/a&gt; scripts&#xA;that build legitimate json bodies and are easily filled into a shell script variable as needed.&lt;/p&gt;&#xA;&lt;p&gt;The basic driving idea was that there are lots of slick ways to pull data &lt;em&gt;out&lt;/em&gt; of JSON(either by programming something with python&amp;rsquo;s json or running a command line tool like jq or whatever), but not as many friendly ways to build some JSON out of a given token or whatever.&#xA;Often, you have a list of identifiers and you need to build a bunch of JSON blobs from that list.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
