Created
June 29, 2013 10:59
-
-
Save nordicdyno/5890740 to your computer and use it in GitHub Desktop.
Url generator for https://github.com/sportsru/gourlmapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Redis; | |
my $redis = Redis->new; | |
open my $fh, '>', 'gen_map.txt'; | |
for my $d (qw(ru ua)) { | |
my $count = 1; | |
for my $i (1_000_000 .. 1_200_000) { | |
print $fh join(" ", $d, "I", "/$i", "/_tags/$d/$i.html") . "\n"; | |
print $fh join(" ", $d, "301", "/tags/$d/$i.html", "/$i") . "\n"; | |
$redis->set("$d:/$i", "I /_tags/$d/$i.html"); | |
$redis->set("$d:/tags/$d/$i.html", "301 /$i"); | |
print "Set $count keys\n" if $count++ % 10_000 == 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment