Skip to content

Instantly share code, notes, and snippets.

@c0bra
Created March 7, 2012 21:46
Show Gist options
  • Select an option

  • Save c0bra/1996447 to your computer and use it in GitHub Desktop.

Select an option

Save c0bra/1996447 to your computer and use it in GitHub Desktop.
Make a wordcloud out of the testimonials of Dancer users
#!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