Guitar Hero, Wikipedia, VK, Perl, Like it!
-
Upload
anatoly-sharifulin -
Category
Entertainment & Humor
-
view
1.941 -
download
0
description
Transcript of Guitar Hero, Wikipedia, VK, Perl, Like it!
![Page 1: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/1.jpg)
Guitar Hero, Wikipedia, VK, Perl, Like it!
Anatoly SharifulinYAPC::Russia 2012
![Page 2: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/2.jpg)
Another story about me and Perl
![Page 3: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/3.jpg)
Guitar Hero: guitar, drums and microphone
Finally got myself a present
![Page 4: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/4.jpg)
![Page 5: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/5.jpg)
I’m Playing...
![Page 6: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/6.jpg)
![Page 7: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/7.jpg)
Plus a singer :-)
![Page 8: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/8.jpg)
Guitar Hero for «kids»Hand made :-)
![Page 9: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/9.jpg)
![Page 10: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/10.jpg)
— Who plays or likes Guitar Hero?
![Page 11: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/11.jpg)
— Why don't you come by? :-)
![Page 12: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/12.jpg)
That's amazing, yeah, but...
![Page 13: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/13.jpg)
1. Few familiar tracks
![Page 14: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/14.jpg)
2. Too many discs,what to buy,
what songs are there?
![Page 15: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/15.jpg)
Eureka!I know what to do...
![Page 16: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/16.jpg)
and I know Perl!
![Page 17: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/17.jpg)
1. WikipediaOn wiki I found all disc and track details
![Page 18: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/18.jpg)
1. WikipediaWrote a Perl script to parse all tracklists
and save to a database
![Page 19: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/19.jpg)
1. Wikipediamap + grep + re + insert db
![Page 20: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/20.jpg)
2. VK.comThere are all (or almost all) tracks
and API on VKontakte!
![Page 21: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/21.jpg)
2. VK.comCreated a VK app,
accessed audio files through the OAuth Authorization
![Page 22: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/22.jpg)
2. VK.comWrote an ojo script to find links
to all mp3 through API
![Page 23: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/23.jpg)
2. VK.comAPI Limits: no parallel requests
and 100 requests per hour from one user
![Page 24: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/24.jpg)
2. VK.comTrack search: corrected some tracks manually, umlauts and NFD (thanks to @nordicdyno)
![Page 25: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/25.jpg)
my $t = NFD( $_->{title} );$t =~ s/\pM//og;
my $q = b( $t )->url_escape->to_string;my $r = g( "https://api.vkontakte.ru/method/audio.search?q=$q&lyrics=1&count=1&access_token=$conf->{token}")->json;
![Page 26: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/26.jpg)
2.VK.comWith the same ojo wrote a downloader of mp3-files
(in one stream, so not to cross the limits)
![Page 27: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/27.jpg)
2.VK.comThe only screw-up of ojo:
all files are of the same length; solution:$ENV{MOJO_MAX_MESSAGE_SIZE} = 100*1024*1024
![Page 28: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/28.jpg)
2.VK.comDownloaded over 650 tracks,
no fun in listening to a local player...
![Page 29: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/29.jpg)
3. Frodio.comCreated a radiostation with a random playlist;
a tiny bug: not all tracks contain correct ID3-tags
![Page 30: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/30.jpg)
3. Frodio.comWrote a script to edit tags
using MP3::Tag (delete ID3v1, set ID3v2)
![Page 31: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/31.jpg)
3. Frodio.comArtist — Track title [GH disc name]
![Page 32: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/32.jpg)
3. Frodio.comTook two days to get a good radio
— Radio Guitar Herohttp://guitarhero.frodio.com
![Page 33: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/33.jpg)
![Page 34: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/34.jpg)
Now I'm kept abreast of all GH tracks
![Page 35: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/35.jpg)
Facebook EffectBut I felt lonely and posted to GH Facebook group
about radio
![Page 36: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/36.jpg)
Facebook Effect2250+ Likes, 43 Shared, 76 Comments,
78 peak of online listeners
![Page 37: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/37.jpg)
![Page 38: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/38.jpg)
Perl, Guitar Hero and Rock’n’Roll
![Page 39: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/39.jpg)
use Perl or die;
![Page 40: Guitar Hero, Wikipedia, VK, Perl, Like it!](https://reader034.fdocuments.us/reader034/viewer/2022051209/54858248b479590f0d8b4db8/html5/thumbnails/40.jpg)
Thanks!Anatoly SharifulinYAPC::Russia 2012