docs: function bin (argv) {
    // setup config
  
    process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
  
    var uri = process.argv[2] || 'https://localhost:4000/random_rate?type=getLastFragment'
    var cert = process.argv[3] || process.env['CERT']
    var display = process.argv[4] || process.env['DISP'] || 'display'
    var mode = process.argv[5] || 'api'
    var user = process.argv[6] || 'http://melvincarvalho.com/#me'
    var tag = process.argv[7]
    var path = process.argv[8] || 'https://localhost/data/buffer/video/'
    root = process.argv[9] || root
    var safe = process.argv[10] || 'off'
    var buffers = process.argv[11] || 2
  
    if (url) {
      path = url.parse(path).path
    }
  
    console.log(process.argv)
    console.log('tag', tag)
    console.log('path', path)
    console.log('webid', user)
  
    var config = require(__dirname + '/../config/config.js')
  
    getMedia(uri, cert, mode, user, tag, path, safe, buffers).then(function (row) {
      debug('media returned')
      debug(row)
      var json = row
      var uri = row.uri
      var cacheURI = row.cacheURI
      var displayURI = cacheURI || uri
      var cmd = display + ' ' + displayURI
  
      var start = json.end || 0
      var duration = 15
      var end = start + duration
      console.log(json.rating)
      console.log(displayURI)
  
      var cmd = display + ' "' + displayURI + '" --start-time ' + start + ' --stop-time ' + end
      console.log(cmd)
      child_process.exec(cmd)
      // main
      var params = {}
      params.uri = uri
      // params.id = json.id
      params.start = start
      params.end = end
      params.webid = user
  
      debug('adding fragment', params)
  
      qpm_media.addFragment(params, config).then(function (ret) {
        if (ret.conn) {
          var conn = ret.conn
          conn.close()
        }
        console.log(ret.ret)
      }).catch(function (err) {
        if (err.conn) {
          var conn = err.conn
          conn.close()
        }
        console.error(err.err)
      })
    }).catch(function (err) {
      console.error(err)
    })
  }