Created
March 22, 2012 09:30
-
-
Save rgs/2157330 to your computer and use it in GitHub Desktop.
A script to create word clouds from perl's core documentation
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 strict; | |
use warnings; | |
use File::Slurp; | |
use Image::WordCloud; | |
for my $file (<perl*.pod>) { | |
my $text = `pod2text $file`; | |
my $wc = Image::WordCloud->new(); | |
$wc->words($text); | |
my $gd = $wc->cloud(); | |
$file =~ s/od$/ng/; | |
open my $fh, '>', $file or die; | |
print $fh $gd->png(); | |
close $fh; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment