Created
March 7, 2012 21:46
-
-
Save c0bra/1996447 to your computer and use it in GitHub Desktop.
Make a wordcloud out of the testimonials of Dancer users
This file contains hidden or 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
| #!perl | |
| use strict; | |
| use warnings; | |
| use Image::WordCloud; | |
| use File::Slurp; | |
| use LWP::Simple; | |
| use HTML::Grabber; | |
| my $html; | |
| my $uri = 'http://perldancer.org/testimonials'; | |
| my $dom = HTML::Grabber->new(html => get($uri)); | |
| my $testimonials = $dom->find('#contain'); | |
| my $gd = Image::WordCloud->new | |
| ->add_stop_words(qw/dancer web framework development perl perldance perldancer/) | |
| ->words( $testimonials->text ) | |
| ->cloud(); | |
| write_file('dancer_cloud.png', {binmode => ':raw'}, $gd->png); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment