Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / phantomjs / lib / phantom / examples / ipgeocode.coffee
1 # Give the estimated location based on the IP address.
2
3 window.cb = (data) ->
4   loc = data.city
5   if data.region_name.length > 0
6     loc = loc + ', ' + data.region_name
7   console.log 'IP address: ' + data.ip
8   console.log 'Estimated location: ' + loc
9   phantom.exit()
10
11 el = document.createElement 'script'
12 el.src = 'http://freegeoip.net/json/?callback=window.cb'
13 document.body.appendChild el