Subject: | [Patch] Extract relative and absolute links |
HTML-SimpleLinkExtor should have the ability for the user to extract:
absolute, relative, only http and only https types of links.
I have attached a patch that does this.
Subject: | abs_rel_http_https_links.patch |
--- SimpleLinkExtor-orig.pm 2007-12-02 23:41:33.000000000 -0500
+++ SimpleLinkExtor.pm 2007-12-03 00:09:34.000000000 -0500
@@ -96,6 +96,34 @@
sub clear_links { $_[0]->_init_links }
+sub rel_links
+ {
+ my $self = shift;
+
+ return grep { !/http|https/ } map { $$_[2] } $self->_link_refs;
+ }
+
+sub abs_links
+ {
+ my $self = shift;
+
+ return grep { /http|https/ } map { $$_[2] } $self->_link_refs;
+ }
+
+sub http_links
+ {
+ my $self = shift;
+
+ return grep { /http/ } map { $$_[2] } $self->_link_refs;
+ }
+
+sub https_links
+ {
+ my $self = shift;
+
+ return grep { /https/ } map { $$_[2] } $self->_link_refs;
+ }
+
sub links
{
my $self = shift;