   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]

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

get_baseurl = (feed) ->
  baseurl = for link in feed.link when link.$.rel == 'self'
    link.$.href
  if baseurl.length < 1
    console.log 'No self link found - cannot work out shorturls'
    process.exit -1
  baseurl = baseurl[0]
  ix = baseurl.lastIndexOf '/'
  baseurl = baseurl.slice 0,ix+1
  console.log 'Base URL = '+baseurl

# shorturl for each 
make_shorturls = (feed,shorturls) ->
  console.log 'make_shorturls...'

  # atom url -> get url
  baseurl = get_baseurl feed
  geturl = baseurl+'get.html'

  # request a short-url for internet kiosk view
  feedurl =get_feedurl feed
  kioskurl = baseurl+'kiosk.html?f='+encodeURIComponent(feedurl)
  url = geturl+'?u='+encodeURIComponent(kioskurl)+'&t='+encodeURIComponent("Kiosk View") 
  add_shorturl shorturls,url

  # work out URLs to be shortened
  # get.html?u=URL&t=TITLE&a=HELPERURL...
