   fix_shorturls = (shorturls,i) ->
     if i >= shorturls.length
       # done
-      console.log 'write shorturls.js'
+      console.log 'write shorturls.json'
       fs.writeFileSync shorturlsfn,JSON.stringify shorturls
     else
       su = shorturls[i]

  # un-needed files in cache?
  for oldfile in oldfiles when oldfile.path? and not oldfile.needed 
    cache.files.push oldfile

# get local cache path for an URL - like java cacheing,
# maps domain name elements and path elements to folders

    # work out shorturl later
    shorturls.push { url: url } 

get_feedurl = (feed) ->
  feedurl = for link in feed.link when link.$.rel == 'self'
    link.$.href
  if feedurl.length < 1
    console.log 'No self link found - cannot work out shorturls'
    process.exit -1
  return feedurl[0]

get_baseurl = (feed) ->
  baseurl = get_feedurl feed
  ix = baseurl.lastIndexOf '/'
  baseurl = baseurl.slice 0,ix+1
  console.log 'Base URL = '+baseurl
