Guest User

Untitled

a guest
Jan 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/usr/bin/perl
  2. @list = ();
  3. $link = '';
  4. while (<>){
  5. while (s/<\s*a\s*href\s*=\s*"([^"]*?)"[^>]*>//){
  6. $link = $1;
  7. $link =~ s/(?:(?:\w*\:\/\/)|)(?:(?:\/\/)|)([^\/:#?]*)((\/|:|#).*)?/\1/;
  8. if ($link =~ /^.+$/){
  9. @list = (@list, $link);
  10. }
  11. }
  12. }
  13.  
  14. @list =sort (@list);
  15. if (@list > 0){
  16. print $list[0]."\n";
  17. for (my $i = 1; $i < @list; $i++){
  18. if (($list[$i-1] ne $list[$i])){
  19. print $list[$i]."\n";
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment