- CONVENIENCE FUNCTIONS
- COPYRIGHT & LICENSE
URI::http::Dump - A module to assist in the reverse engineering of URL parameters.
This module is no longer officially supported by my standards -- though it should do what it does just fine. It violates the blackbox of URI.
## Whatever you get the picture. use constant URI => 'http://longassuri:obsecureport' . '/stupid_path/segments/probably/not/needed/but/there/for/fun/' . 'dumbFile.that.says.nothing.of.security' . '?Stupidquerry=HexencodedNonsense&Oth=er&cra=p' ; use URI::http::Dump; URI::http::Dump->new( URI )->makeLifeEasy; perl -MURI::http::Dump -e'URI::http::Dump->new("uri")->makeLifeEasy'; ## Same as. perl -MURI::http::Dump -e'mle("http://google.com")' ## Overview of process $ perl -MURI::http::Dump -e'mle("http://google.com")' $ vim url.txt ## change stuff $ perl -MURI::http::Dump -e'mle("http://google.com")' http://google.com/foobar.do?a=b $ firefox $( perl -MURI::http::Dump -e'mle("http://google.com")' ) && vim url.txt
The simplicity of Unix is in the way it treats (most) everything like a file, and this is just a simplicity mechanism so you can treat URIs as a file too via YAML markup, ie, easily manipulate them with a text editor.
Say you're trying to reverse engineer a website for the purpose of automation and the URL that is causing annoyance has a shit ton of parameters with numerous different quirks: ie, base64 encoding, custom encoding, hexecoding nonsense, or maybe they just spelt everything in pig latin. Now, for reasons known to the reader, you need to make sense of this: this module will help you.
This module really has a small scope, and the route of action it takes depends entirely on the existance of the URI's file-store. On the first invocation, before the file-store exists, URI::http::Dump will decompile the URL provided to new() to its basic URI components and store it to a file.
On the second invocation, URI::http::Dump will compile the URI from the components in the file-store and output the URI to stdout. It will continue on this route for each subsequent invocation until the file-store is deleted. Then it will re-render the file from the arguments to constructor so you can begin the process again.
Because of the internal function of the URI module query segments encoded and unencoded in the respective steps, ie., the file will probably look more ledgable than the URI by default.
If you have deep voodoo you need to do to the URI in an automated fashion you can utilize a Moose around method modifier on the
All URIs must start with http://
The CANONICAL_SRC element in the dump *NEVER* changes. It is there for reference only
Convenience functions calls
->new with provided uri_string, and then calls
dump are not inverses,
load takes a HashRef;
dump outputs yaml.
The input to
->new can be one of the following: a URI, the file's location with a YAML dump of the URI, or a HashRef in the format of the output of the
Returns a dump of the URI in the YAML format. Defaults to url.txt.
Saves the dump of the URI in the YAML format to the file specified in
->filename, which is by default url.txt.
Specifies the filename of the file-store.
Accepts a HashRef of the YAML file-store. Returns a new
URI::http representation of the HashRef.
Accepts the YAML file-store location outputs a HashRef of the YAML file-store. This HashRef is processed by
>load. Returns a
URI representation of the file-store.
It will check to see if the file-store exists (url.txt), if it exists it will open the file construct the url form the components, and then dump the url the file-store composed into to STDOUT.
If the file doesn't exist, it will generate the file-store from the component.
<me at evancarroll.com>
Please report any bugs or feature requests to
bug-uri-http-dump at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-http-Dump. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
Special thanks goes out to nothingmuch for providing emotional support and being an all around nice guy. I <3 YOU BUDDY.
Copyright 2008 The man himself, Evan Carroll, no rights reserved -- have fun newbs.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.