Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 03, 2016, 12:53:49 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: LinkGrabber: Grabs all links on a webpage and exports as a text file.  (Read 13033 times)

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 638
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
http://scancode.dcme...kgrabber-install.htm

It's a bookmarklet that grabs all links on a webpage and exports them as a text file.. Enjoy.

Edit: typo
« Last Edit: April 12, 2008, 09:33:38 AM by scancode »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,258
    • View Profile
    • Coding Snacks by Lanux128
    • Read more about this member.
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #1 on: January 18, 2008, 02:50:38 AM »
sounds good, scancode.. will try this out later. btw, will it work on Firefox?

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #2 on: January 18, 2008, 06:13:57 AM »
It will, lanux. It was tested under ie, ff and opera.

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,473
    • View Profile
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #3 on: April 12, 2008, 09:18:06 AM »
this is very interesting

can it save the txt file though?

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 638
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #4 on: April 12, 2008, 09:23:17 AM »
this is very interesting

can it save the txt file though?

Sure it can, I can add a button, but it'll work in IE only. You can always right-click on it :)

This one will save it as HTML / TXT on IE6
javascript:var%20i;var%20o_0=window.open('','o_0','width=450,height=250,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1');o_0.document.open('text/plain','replace');for%20(i=0;i%3Cdocument.links.length;i++){o_0.document.write(document.links[i].href+'\r\n\r\n');}%20o_0.document.title='Links';o_0.document.close();o_0.document.execCommand("SaveAs");void%200;
« Last Edit: April 12, 2008, 09:32:34 AM by scancode »

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,473
    • View Profile
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #5 on: April 12, 2008, 10:14:34 AM »
very nice!

how can I add regex filters to display specific links (or text) ? eg *.some.com/*.pdf

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 638
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #6 on: April 12, 2008, 10:17:34 AM »
Honestly, that escapes my knowledge. You'd better off parsing the list.
« Last Edit: April 12, 2008, 11:18:45 AM by scancode »

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,473
    • View Profile
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #7 on: April 12, 2008, 10:26:56 AM »
thanks your work is brilliant

it also gives me many ideas

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 638
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #8 on: April 12, 2008, 10:34:03 AM »
Here's a cleaned up version, in case you want to add the regexp yourself.
Thank you for your kind words  :)
Show Source Code
Code: Javascript [Select]
  1. var i;
  2. var o_0 = window.open('', 'o_0', 'width=450,height=250,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1');
  3. o_0.document.open('text/plain', 'replace');
  4. for (i = 0; i < document.links.length; i++) {
  5.     o_0.document.write(document.links[i].href + '\r\n\r\n');
  6. }
  7. o_0.document.title = 'Links';
  8. o_0.document.close();
  9. o_0.document.execCommand("SaveAs"); // ie only; show save as dialog
  10. void 0;

« Last Edit: April 12, 2008, 11:19:16 AM by scancode »

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 638
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #9 on: April 12, 2008, 11:18:05 AM »
Woot! Regexp is working.

javascript:var i;var p_0=prompt("Enter your regexp (default%3A don't filter)%3A","/()/");eval("p_0="%2Bp_0%2B";");var o_0=window.open('','o_0','width=450,height=250,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1');o_0.document.open('text/plain','replace');for(i=0;i%3Cdocument.links.length;i%2B%2B){if(p_0.test(document.links[i].href)){o_0.document.write(document.links[i].href%2B'%5Cr%5Cn%5Cr%5Cn')}}o_0.document.title='Links';o_0.document.close();o_0.document.execCommand("SaveAs");void 0;

Code: Javascript [Select]
  1. var i;
  2. var p_0 = prompt("Enter your regexp (default: don't filter):", "/()/");
  3. eval("p_0=" + p_0 + ";"); // HELP! Is there a cleaner way? // for example sets a comment.
  4. var o_0 = window.open('', 'o_0', 'width=450,height=250,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=1');
  5. o_0.document.open('text/plain', 'replace');
  6. for (i = 0; i < document.links.length; i++) {
  7.     if (p_0.test(document.links[i].href)) {
  8.         o_0.document.write(document.links[i].href + '\r\n\r\n')
  9.     }
  10. }
  11. o_0.document.title = 'Links';
  12. o_0.document.close();
  13. o_0.document.execCommand("SaveAs");
  14. void 0;

Enjoy :)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,473
    • View Profile
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #10 on: April 12, 2008, 02:23:11 PM »
marvelous!
many thanks!
 :)

jimmsta

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1
    • View Profile
    • Donate to Member
Re: LinkGrabber: Grabs all links on a webpage and exports as a text file.
« Reply #11 on: August 28, 2008, 01:57:02 PM »
Awesome :D