Last active
August 29, 2015 14:24
-
-
Save vyuh/6024baf96e9131a67882 to your computer and use it in GitHub Desktop.
Fetches all links as of now. eventually, i want it to remove duplicate bookmarks and then sort them
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use HTML::TreeBuilder::XPath; | |
my $file = shift; # first argument is bookmarks HTML filepath | |
my $tree = new HTML::TreeBuilder::XPath; | |
$tree->parse_file($file); | |
use Data::Dumper; | |
my @links = $tree->findnodes('//a'); | |
use List::Flatten; | |
print join ' ', flat @{$_}{ qw/href _content/ }, "\n" for (@links); | |
#woah http://www.perlmonks.org/?node=References%20quick%20reference |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment