title: How to strip a url and get an unknown variable from a URL?
body: <p>I have several URLs that look like this:</p>
  
  <p><a href="http://domain.com/data/id/0000/random_title/" rel="nofollow">http://domain.com/data/id/0000/random_title/</a></p>
  
  <p><code>domain.com/data/id/</code> &lt;--- are a constant and never change</p>
  
  <p><code>/0000/</code> &lt;--- I want to get this value (always 4 numbers)</p>
  
  <p><code>/title/</code> &lt;-- this is different on every URL</p>
  
  <p>What I need is a function that get the url from a row... analyze it(strip?)and create a new property with those 4 numbers.. </p>
  
  <p>I'm using Kimono to extract the data.... kimono allows the use of functions to modify the results and I found some examples but no documentation:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>function getpost_number(data) {
  var post_number = 0;
  for(var url in data.results) {
     data.results[url].forEach(function(row) {
      var parts = url.split("/");
      console.log(parts[5], parts[6]);
     });
    };
    data.post_number = post_number;
    return data;
  }</code></pre>
  </div>
  </div>
  </p>