Pages: [1]   Go Down
Author Topic: [source] fts docRFC down  (Read 2586 times)
kodo no kami
RegMem
*

Karma: +0/-0
Offline Offline

Posts: 44


« on: July 28, 2015, 05:14:28 PM »



e ae galera aqui um pequeno script que salva documentação RFC que sao usadas para padronização de protocolos principalmente de rede

github

Code:
#!/usr/bin/perl
#coder: kodo no kami
#data: 28/07/15

require WWW::Mechanize;

my $url = "https://tools.ietf.org/rfc/";
my $rfc;

my $kodo = WWW::Mechanize->new;

print "==========================\n      fts docRFC down\n==========================\n";

if(($ARGV[0] eq "--help") || ($ARGV[0] eq "-h"))
{
print "coder: kodo no kami\n\nsintaxe:\n script.pl <rfc>\n script.pl -r <numero do rfc>\n\nexemplo:\n script.pl rfc3330\n script.pl -r 3330\n\n";
exit(0);
}
if($ARGV[0] eq "-r")
{
$rfc = "rfc" . $ARGV[1];
$url .= $rfc . ".txt";
}
else
{
$rfc = $ARGV[0];
$url .= $rfc . ".txt";
}

$kodo->get($url);
open(ARQS,">$rfc.txt");
print ARQS $kodo->content;
print "RFC salvo com sucesso\n\n";
close(ARQS);

para usar ele basta usar o nome do script seguido do rfc, exemplo

Code:
$ perl script.pl rfc1918

ou usar a sintaxe -r seguido do numero

Code:
$ perl script.pl -r 1918

ele vai salvar o arquivo em formato txt
Logged


Author Topic: [source] fts docRFC down(Read 2586 times)
aofkitchan
Member
*

Karma: +0/-0
Offline Offline

Posts: 2


« Reply #1 on: September 17, 2015, 06:12:03 AM »


What had already read it, read it, the more you know. Accuracy is very good memory.
Logged


Pages: [1]   Go Up
Print
Jump to: