title: Bash/Curl example of pocket oAuth login
body: <p>I'm trying to get a simple bash script working with the pocket api. All I want to do is authenticate with pocket and download my list of articles (actually, only the count)</p>
  
  <p>I'm a little confused by the way that the oauth process works. </p>
  
  <ul>
  <li>I've registered my app with the pocket api and have a consumer key</li>
  <li>its marked as in "development" - I'm not sure if this is important. </li>
  </ul>
  
  <p>The bit that's confusing me is that it seems that the way that the oAuth flow works with it's redirect uris is that it only really works with a gui (i.e a browser) - is it possible to do this with a bash script?</p>
  
  <p>Here is what I have below. it works up until I have the TOKEN, but then I'm not sure what to do next.</p>
  
  <pre><code>    #!/bin/bash
  
      REDIR="redirect_uri=pocketapp1234:authorizationFinished"
      KEY=21004-xxxxxxabcabcabc # you can assume this is the consumer key pocket issues for my app.
      CODE=`curl -X POST --data "consumer_key=$KEY&amp;$REDIR" https://getpocket.com/v3/oauth/request`
  
      echo "OK - code is $CODE"
      TOKEN=$(echo $CODE | awk -F"=" '{print $2}')
      echo "OK - token is $TOKEN"
  
      AUTH="consumer_key=$KEY&amp;$CODE"
  
  
  # This line seems not to work
       curl -v  "https://getpocket.com/auth/authorize?request_token=$TOKEN&amp;$REDIR"
  </code></pre>