Skip to content

Instantly share code, notes, and snippets.

@scan
Created July 27, 2012 11:59
Show Gist options
  • Save scan/3187594 to your computer and use it in GitHub Desktop.
Save scan/3187594 to your computer and use it in GitHub Desktop.
http = require 'http'
for url, i in urls then do (url, i) ->
if url.match /^http/i
try
req = http.request (require 'url').parse(url), (res) ->
console.log "##{i}: Fehler #{res.statusCode} bei \"#{url}\"" if res? and res.statusCode isnt 200
req.on 'error', (err) ->
console.log "##{i}: Fehler \"#{err.message}\" bei \"#{url}\""
req.end()
catch err
console.log "##{i}: Fehler \"#{err.message}\" bei \"#{url}\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment