URI::CrawlableHash - convert ajax uri to crawlable
use URI::CrawlableHash; my $uri = URI->new("http://example.com/#!key1=value1&key2=value2"); # uri for crawler $uri->fragment_to_query; # http://example.com/?_escaped_fragment_=key1=value1%26key2=value2 # uri for browser $uri->query_to_fragment; # http://example.com/#!key1=value1&key2=value2 # always convert to #! (Google says pretty url) $guard = URI::CrawlableHash->convert_always("hash"); # always convert to ?_escaped_fragment_ (Google says ugly url) $guard = URI::CrawlableAjax->convert_always("query");
URI::CrawlableHash is URL transformer for AJAX URLs.
See http://code.google.com/web/ajaxcrawling/docs/specification.html
It adds some method to the URI namespace. I hate this approach but I need it.
URI
See also HTML5's history.pushState or history.replaceState http://www.w3.org/TR/html5/author/history.html#history
$uri->has_crawlable_hash; # return true if contain #!
$uri->has_escaped_fragment; # return true if contain _escaped_fragment_
This method return ugly URI. Note that this is destructive method.
If you want new object, call $uri->clone before call this method.
This method return pretty URI. This method is destructive itself too.
This method will make you happy or crash everything. please read source.
mala <cpan@ma.la>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install URI::CrawlableHash, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::CrawlableHash
CPAN shell
perl -MCPAN -e shell install URI::CrawlableHash
For more information on module installation, please visit the detailed CPAN module installation guide.