Twitter2Mp3
From Mike Beane's Blog
I have no idea if this will go anywhere and the concept came from listening to Adam Curry on No Agenda.
Idea
Premise: parse Twitter feed using Perl, utilize Text2Wav (Festival) to convert to a wav file and then LAME encode the result to mp3.
Audio Result
<flashmp3>http://www.rabbibob.com/cstrike/20090321_twitter.mp3%7Cautostart=no%7Cloop=no%7CfirstTrackName=Sleeper39_1997</flashmp3>
Command Line
text2wave -F 16000 htt.txt -o test2.wav
lame -s 8 test2.wav test2.mp3
Text Origin
- Things such as 'h t t p' eventually would be removed.
Oblivion said 15.9 miles down 4.1 to go. 10:59 avg pace. #runners Phreak said @rabbibob you're playing MW - do i have you on facebook? rabbibob said @DAVEfromNY that sucks! justinrussell said It's funny; whenever I go to choose a font for a project, I always end up with the same 4 or 5. Designers, you may start criticizing me now. chrismarquardt said Voll gut! http://twitpic.com/2bfq1 DAVEfromNY said WTF?!?! First day of spring it snows, then the second day of spring my furnace dies! Somehow I blame that damn groundhog for all this! dashdrum said Free lunch from @gentryart at 9 Irish Brothers Pub rabbibob said @Phreak @tomit I'm slightly addicted to MW atm Phreak said @tomit i think i am, yes. i had about five invites, i accepted them all tomit said @Phreak I catch the blame for MW's from everyone! You part of my mafia? cc_chapman said Great video by @cmajor - SXSW in 2 Words - http://bit.ly/j4pLw tomit said Added commenting to what will be my main blog. Much more work to do on it though. http://bit.ly/cqTCh Oblivion said http://twitpic.com/2beor - 9.75 miles. I lost a glove. Crap. Phreak said way to get husband to stay out of the house - tell him he has 50 things to do when he gets home UberSchwarz said Waiting for @draithon to arrive for a day of picture-taking! Oblivion said Sweet. Just found a roll of electrical tape on the side of the road. Sunglasses fixed. 8.33 mi 1:34 #runners Phreak said can't think of what it is i'm supposed to be doing other than playing Mafia Wars - damn @tomit rabbibob said Erin is all signed up for tee-ball this spring! Callum unfortunately didn't make the minimum age. rabbibob said @UberSchwarz http://tinyurl.com/dgjcnj TFTTF 175 white balance vid Phreak said glad i'm not a redhead http://tinyurl.com/d2y2qq UberSchwarz said Not sure I liked the ending to BSG.... marcapitman said It's sort of depressing to UNLOAD the trash I just loaded into the van. The transfer station is closed on Saturdays until April! Phreak said tweetdeck was acting the maggot and i had to reinstall - got sick of being locked out of my Twitter account for no good reason MrTweet said Every user has different purposes for using Twitter, and our aim is to help them do so in the easiest way possible. New posting coming soon! Oblivion said http://twitpic.com/2bc4q - Mile 4.5. Feeling good. Beautiful day, @AmandaPalmer in my ears. #runners Oblivion said Famnm. Just lost the nosepiece to my sunglasses and I forgot spare bandaids. Shultzman said I don't know why @scottsigler is hating on the BSG ending so much. I liked it. Watched it twice. Had something for everyone. tomit said I love these splash screens. That is just so funny!!! re: http://ff.im/1DnPA merlyn said gonna try dialing back on the oxycontin today to find that sweet spot between wooziness and pain. already down to 60% of max dose cc_chapman said Dylan at Lacrosse Practice http://twitpic.com/2b9m8 Shultzman said RT @jayrosen_nyu All credit to the Washington Post for running Chris Mooney's op ed on George Will's global cooling claims http://is.gd/ojPY Oblivion said Water planted. Heading out now. cc_chapman said At my first lacrosse practice with Dylan. Can't wait for the games. Fun sport. UberSchwarz said yeah, you can nest arrays in certain languages. Its pretty slick Oblivion said Would anyone be interested in tracking my run with Google Latitude? Gmail oblivion9999 if interested. #runners Oblivion said Out stashing water for my 20 miles. About 2 hours behind schedule. Feh. #runners dashdrum said Listening to the SXSW 2009 Showcasing Artists download - set 3. This is a very eclectic mix of music. I figured it would all be indie. dashdrum said RT @mjasay: “Facebook is for those you used to know, Twitter is for those who you will know.â€(via Aaron Asay) rabbibob said @UberSchwarz If it works, you'll get a kick out of what I'm going to do with it. rabbibob said @UberSchwarz I'm accessing info the array supplied from an existing Perl module (Net::Twitter). I hadn't seen [Array[Array{Hash}]] before. Oblivion said Forerunner 305 fixed. Needed to delete all Courses on unit and resend. Had previously seen a "Database Error" on the unit. #runners Oblivion said Bah! Getting delayed on my 20 miles because my Forerunner 305 will not load the Course I made for it after I tweaked it a bit. #runners marcapitman said Oh joy! Girl Scouts were selling cookies at the supermarket today! I DO get my fix this year! Smorgy said Off to bed... talking in the dark about travel memories UberSchwarz said Trying to research White Balance. dashdrum said I think I'm the youngest person here - except for the staff. UberSchwarz said @rabbibob what's the purpose of the array? rabbibob said Implemented. my $location=$timeline[0][0]{'user'}{'location'}; Now off to start my morning. chrismarquardt said Evil Eye http://twitpic.com/2b5m0 rabbibob said Perlmonks are great (re: a helpful lot). I have notes now and will look at the AoAoH later. CPANr said Getopt::Long - Parse long and short command line options in a convenient way. http://tinyurl.com/q4mjc cc_chapman said Up and at them. Busy morning of Lacrosse and Drama. cc_chapman said 100 liters of H2O donated for every follower of @WorldH2O @chlorine & Facebook group member http://is.gd/oeen #WWD09 #worldwaterday DucSloerie said Is this Twitter working? rabbibob said Befuddled by the array type I'm currently staring at and how to handle it correctly vs building a crescent hammer to deal with it. Smorgy said Havent tweeted much today.. had a nice lazy day with @fortheinsane rabbibob said @uberschwarz @draithon short HDR bit discussed on TFTTF #346 drewdomkus said unless some sort of miracle happens, looks like all the important files on the iRiver are really gone. total fail on my part. i'm so pissed. merlyn said Almost gave up on #Dollhouse, but tonight's episode drew me in. Deep conspiracies, nice. Send me more, quickly! jluscious said Another crazy night. Counting down the hours to my weened! YvoLaLu said It says "Von Iva. Period."- Anna pointing @yvolalu lack of a bra drewdomkus said i stupidly and accidentally formatted an iRiver IFP-790. if anyone knows of any magical way to recover the files, please get in touch. #fb closedblueyes said "There are three flowers in the vase and one of them is green." Holy shit, tonight's Dollhouse was awesome. rosicrux said first real bbq of the season. Bison steak, shrimp, zucchini, and fresh corn on thje cob all on the grill to kick it off jessicamullen said hanging out w @adranchjason + @cynthiaisgr8 about 2 record... + got today's ep up finally! http://thepopularpodcast.com/?p=517 fortheinsane said @tomit 6 seasons, awesome, so depressing but awesome tomit said @fortheinsane I think I want to try and watch that show now that we don't have BSG. How many seasons did it have? darthvader said Trust me, it's *not* impossible, just highly improbable. Speaking of improbable, as a boy, I built C-3PO. fortheinsane said Watching six feet under wootsellout said $69.99 : Wizcom Quictionary 2 Premium Scanning Pen http://sellout.woot.com woot said $19.99 : Tornado USB Data Transfer with PC Eraser http://www.woot.com darthvader said If you're stinging from the BSG spoilers on Twitter, maybe this will take some of the edge off - I am Luke's father. marcapitman said RT @starfocus: “"Did you sleep well?" "No, I made a couple of mistakesâ€- Stephen Wright : Hope everyone sleeps well! :) toyotaboy said @arnell: are you trying to get @comcastcares attention? tomit said Thinking that I am just going to start using my blog even though I'm still working on it. May push me to work faster. ambermacarthur said RT @chrisdick - Twitter is like cable, so many channels and nothing on! (Yeah, but like cable, not ready to cut the cord just in case - AM) DAVEfromNY said Lee went to take a bath and there was no hot water. Turns out our boiler bit the dust :-( Gonna be a cold night and an expen$ive weekend! Arnell said Comcast is out AGAIN!!! Man they suck!!! MuyLani said ah! look at the time. gotta get something to eat before I pick up Olie from her Granny's closedblueyes said @MuyLani I've gone to a sushi place alone before. It's not terrible, but definitely not as fun as going with friends. drewdomkus said got word that our new shirts will be ready on tuesday, then i'll process them for delivery. sorry for the delay! http://minionarmy.com MuyLani said @closedblueyes yes! sushi sounds delicious right now but it's no fun to eat alone :-( marcapitman said Check out this Twitter map http://bit.ly/12fdG THIS is what I wished LinkedIn offered. closedblueyes said STARVING for sushi. marcapitman said RT @kanter: @sproutbuilder @carnet is on my map at about 2 PM right above @dnwallace and next to @marcapitman http://is.gd/ogvl marcapitman said New personal blog: Out of the mouth of babes: This morning, I told job Caleb to stop talking. .. http://poprl.com/jVF jessicamullen said change of plans - i now cordially invite you to buy me a drink at longbranch tonight. justinrussell said Funny how a fairly small traffic change still costs a million bucks to complete. It's a good change, though. http://is.gd/ohcI jntracks said Last tweet was screaming audience from my view. Not enough lite but they got excited about net fame LeoLaporte said The side-effects for screening are minimal. The PSA is a blood test that can be done along with other screenings... re: http://ff.im/1Davu jluscious said Good for you Enzo...dominate that ducky!!! http://twitpic.com/2ateu jessicamullen said lol anyone want to go to cover 3 with us for dinner and drinks? http://www.yelp.com/biz/cover-3-austin gentryart said Added more paintings to the site, gentryart.us check out the profile dashdrum wrote for me! jluscious said Can't seem to shake the tiredness lately... Just exhausted dashdrum said Can't fit my thought into 140 characters, so forget it!
Fetch Code
#!/usr/bin/perl use strict; use warnings; use Net::Twitter; my $twit = Net::Twitter->new({username=>"user", password=>"password" }); my $last_id=1363944982; #work this out later my @timeline = $twit->friends_timeline({count => 200, since_id => $last_id }); my $timeline; my $i; while ($timeline[0][$i]) { my $location=$timeline[0][$i]{'user'}{'location'}; my $screenname=$timeline[0][$i]{'user'}{'screen_name'}; my $msg=$timeline[0][$i]{'text'}; $msg=~s/https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?/link /g; print "$screenname said $msg\n"; $i++; }
Code Notes
$msg=~s/https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?/link /g;
Fetch Result
results in (chopped)
$VAR1 = [ [ { 'source' => 'web', 'favorited' => bless( do{\(my $o = 0)}, 'JSON::PP::Boolean' ), 'truncated' => $VAR1->[0][0]{'favorited'}, 'created_at' => 'Sat Mar 21 10:27:17 +0000 2009', 'text' => '@uberschwarz @draithon short HDR bit discussed on TFTTF #346', 'user' => { 'location' => 'Behind you...', 'followers_count' => 99, 'profile_image_url' => 'http://s3.amazonaws.com/twitter_production/profile_images/105270932/3371878294_7e0723920e_normal.jpg', 'protected' => $VAR1->[0][0]{'favorited'}, 'name' => 'Rabbi Bob', 'url' => 'http://www.rabbibob.com/', 'id' => 2955291, 'description' => 'degradable', 'screen_name' => 'rabbibob' }, 'in_reply_to_user_id' => 3708131, 'id' => 1365343447, 'in_reply_to_status_id' => undef, 'in_reply_to_screen_name' => 'UberSchwarz' } ] ]