Guitar Hero, Wikipedia, VK, Perl, Like it!
Upcoming SlideShare
Loading in...5

Guitar Hero, Wikipedia, VK, Perl, Like it!



Lightning talk at #yr2012

Lightning talk at #yr2012



Total Views
Views on SlideShare
Embed Views



1 Embed 2 2


Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Guitar Hero, Wikipedia, VK, Perl, Like it! Guitar Hero, Wikipedia, VK, Perl, Like it! Presentation Transcript

    • Guitar Hero,Wikipedia,VK, Perl, Like it! Anatoly Sharifulin YAPC::Russia 2012
    • Another storyabout me and Perl
    • Guitar Hero: guitar,drums and microphone Finally got myself a present
    • I’m Playing...
    • Plus a singer :-)
    • Guitar Hero for «kids» Hand made :-)
    • — Who plays or likes Guitar Hero?
    • — Why dont you come by? :-)
    • Thats amazing, yeah, but...
    • 1. Few familiar tracks
    • 2. Too many discs, what to buy,what songs are there?
    • Eureka!I know what to do...
    • and I know Perl!
    • 1. WikipediaOn wiki I found all disc and track details
    • 1. WikipediaWrote a Perl script to parse all tracklists and save to a database
    • 1. Wikipediamap + grep + re + insert db
    • 2.VK.comThere are all (or almost all) tracks and API on VKontakte!
    • Created a VK app,accessed audio files through the OAuth Authorization
    • 2.VK.comWrote an ojo script to find links to all mp3 through API
    • API Limits: no parallel requestsand 100 requests per hour from one user
    • 2.VK.comTrack search: corrected some tracks manually, umlauts and NFD (thanks to @nordicdyno)
    • my $t = NFD( $_->{title} );$t =~ s/pM//og;my $q = b( $t )->url_escape->to_string;my $r = g( "$q&lyrics=1&count=1&access_token=$conf->{token}")->json;
    • 2.VK.comWith the same ojo wrote a downloader of mp3-files (in one stream, so not to cross the limits)
    • The only screw-up of ojo: all files are of the same length; solution:$ENV{MOJO_MAX_MESSAGE_SIZE} = 100*1024*1024
    • Downloaded over 650 tracks,no fun in listening to a local player...
    • 3. Created a radiostation with a random playlist;a tiny bug: not all tracks contain correct ID3-tags
    • 3. Wrote a script to edit tagsusing MP3::Tag (delete ID3v1, set ID3v2)
    • 3. Frodio.comArtist — Track title [GH disc name]
    • 3. Frodio.comTook two days to get a good radio — Radio Guitar Hero
    • Now Im kept abreast of all GH tracks
    • Facebook EffectBut I felt lonely and posted to GH Facebook group about radio
    • Facebook Effect2250+ Likes, 43 Shared, 76 Comments, 78 peak of online listeners
    • Perl, Guitar Hero and Rock’n’Roll
    • use Perl or die;
    • Thanks! Anatoly SharifulinYAPC::Russia 2012