chrome bookmarks linkcheck


/ Published in: Bash
Save to your folder(s)

get urls from bookmarks, run wget against the list of urls, then parse the log looking for bad return codes


Copy this code and paste it in your HTML
  1. grep '\"url\":' Bookmarks | awk '{ print $2}' | sed 's/"$//' | sed 's/^"//' > linkchecks # creates the list of urls to check
  2. wget --server-response --spider -o log_file2_wget -ilinkchecks # check the links for validity and produce log with return code values
  3. gawk '{ /^--/ {VAR=$3}; /^..HTTP/ {print VAR" "$2" "$3}; /timed.out.$/ {print VAR" "$2" "$3} }' log_file2_wget > log_http_rc
  4.  
  5. OUTPUT:
  6.  
  7.  
  8. http://www.macromedia.com/special/forums_down.html?forumid=15 301 Moved
  9. http://www.adobe.com/special/forums_down.html?forumid=15 200 OK
  10. http://www.outpost.com/peripherals/ 301 Moved
  11. http://frys.com/peripherals/ 404 Not
  12. http://4808.runbox.com/docs/en/help/manager/access/pop/default.doc 302 Moved

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.