Advertise

Monday, 16 September 2013

Download any Page of Website in Normal Text Format [Perl Tool]

Below tool, will help you in Downloading any Site Name in Text Format

PHP Code:
#!/usr/bin/perl
# Author    : KroKite
# URI        : http://krokite.com || http://worldofhacker.com
# Description    : You can Download any Site Page in Text Format with this Script.
# Usage        : perl %prog {%prog is the file name that you will save this script}
use strict;
use 
warnings;
use 
LWP::Simple;
use 
HTML::TreeBuilder;
use 
HTML::FormatText;
main(@ARGV);
sub main{
    print
'                                      
 /$$   /$$       /$$$$$$$         /$$$$$$        /$$   /$$       /$$$$$$       /$$$$$$$$       /$$$$$$$$
| $$  /$$/      | $$__  $$       /$$__  $$      | $$  /$$/      |_  $$_/      |__  $$__/      | $$_____/
| $$ /$$/       | $$  \ $$      | $$  \ $$      | $$ /$$/         | $$           | $$         | $$     
| $$$$$/        | $$$$$$$/      | $$  | $$      | $$$$$/          | $$           | $$         | $$$$$  
| $$  $$        | $$__  $$      | $$  | $$      | $$  $$          | $$           | $$         | $$__/  
| $$\  $$       | $$  \ $$      | $$  | $$      | $$\  $$         | $$           | $$         | $$     
| $$ \  $$      | $$  | $$      |  $$$$$$/      | $$ \  $$       /$$$$$$         | $$         | $$$$$$$$
|__/  \__/      |__/  |__/       \______/       |__/  \__/      |______/         |__/         |________/

'
;
    print 
"Content-type: text/html\n\n";
    print 
"[+] Please report any bug on http://krokite.com Contact page\n";
    print 
"[+] Enter Site URL for processing in text\n";
    print 
">>> ";
    
my $site = <stdin>;
    
chomp($site);

    
my $url get($site);

    
my $format HTML::FormatText->new;
    
my $treepattern HTML::TreeBuilder->new;
    
$treepattern->parse($url);

    
my $getPage $format->format($treepattern);

    
# If you also Want to View Page on Run time than Just Un-Comment below line.
    # print $getPage;

    # if you do not want to Download the file than Comment below
    
my $safeChar "a-zA-Z0-9_-";
    
$site =~ s/http:\/\/www\.//g;
    
$site =~ s/\./-/g;
    
$site =~ s/[^$safeChar]//g;
    
open(FH">$site.txt");
    print 
FH $getPage;
    
close(FH);

Git Source :- https://github.com/krokite/Misc-Scripts/..._Format.pl
 
World of Hacker © 2011 Creative Commons License
World of Hacker by KroKite is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Based on a work at http://www.worldofhacker.com.
Permissions beyond the scope of this license may be available at https://groups.google.com/forum/#!newtopic/hackerforum.