Created
January 3, 2014 15:26
-
-
Save waffle2k/8239671 to your computer and use it in GitHub Desktop.
Get the twitter handles for all Toronto City Council.
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
#!/usr/bin/perl | |
use strict; | |
my @urls = qw( http://toronto.about.com/od/civicscityservices/tp/city_councillors_contact.htm | |
http://toronto.about.com/od/civicscityservices/tp/city_councillors_contact.01.htm | |
http://toronto.about.com/od/civicscityservices/tp/city_councillors_contact.02.htm | |
http://toronto.about.com/od/civicscityservices/tp/city_councillors_contact.03.htm | |
http://toronto.about.com/od/civicscityservices/tp/city_councillors_contact.04.htm ); | |
my @twitter; | |
for my $url ( @urls ){ | |
for( `curl -s $url | html2text` ){ | |
if( /\s(\@\S+)/ ){ | |
push( @twitter, $1 ); | |
} | |
} | |
} | |
print join( "\n", @twitter ) . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment