Evan Carroll > URI-http-Dump > URI::http::Dump

Download:
URI-http-Dump-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

URI::http::Dump - A module to assist in the reverse engineering of URL parameters.

CAVEAT ^

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.

SYNOPSIS ^

        ## 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

DESCRIPTION ^

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 ->load or ->dump functions.

All URIs must start with http://

The CANONICAL_SRC element in the dump *NEVER* changes. It is there for reference only

EXPORT ^

->mle( 'uri_string' );

Convenience functions calls ->new with provided uri_string, and then calls ->makeLifeEasy

METHODS ^

Beware ->load and dump are not inverses, load takes a HashRef; dump outputs yaml.

->new( $data )

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 ->dump function.

->dump

Returns a dump of the URI in the YAML format. Defaults to url.txt.

->dumpFile

Saves the dump of the URI in the YAML format to the file specified in ->filename, which is by default url.txt.

->filename

Specifies the filename of the file-store.

CONVENIENCE FUNCTIONS ^

load( $hashRef )

Accepts a HashRef of the YAML file-store. Returns a new URI::http representation of the HashRef.

loadFile( $fileLocation )

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.

makeLifeEasy ( $url )

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.

AUTHOR ^

Evan Carroll, <me at evancarroll.com>

BUGS ^

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.

SUPPORT ^

You can find documentation for this module with the perldoc command.

perldoc URI::http::Dump

You can also look for information at:

ACKNOWLEDGEMENTS ^

Special thanks goes out to nothingmuch for providing emotional support and being an all around nice guy. I <3 YOU BUDDY.

COPYRIGHT & LICENSE ^

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.

syntax highlighting: