Your SlideShare is downloading. ×
Guitar Hero, Wikipedia, VK, Perl, Like it!
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

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

1,481
views

Published on

Lightning talk at #yr2012

Lightning talk at #yr2012


0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,481
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Guitar Hero,Wikipedia,VK, Perl, Like it! Anatoly Sharifulin YAPC::Russia 2012
  • 2. Another storyabout me and Perl
  • 3. Guitar Hero: guitar,drums and microphone Finally got myself a present
  • 4. I’m Playing...
  • 5. Plus a singer :-)
  • 6. Guitar Hero for «kids» Hand made :-)
  • 7. — Who plays or likes Guitar Hero?
  • 8. — Why dont you come by? :-)
  • 9. Thats amazing, yeah, but...
  • 10. 1. Few familiar tracks
  • 11. 2. Too many discs, what to buy,what songs are there?
  • 12. Eureka!I know what to do...
  • 13. and I know Perl!
  • 14. 1. WikipediaOn wiki I found all disc and track details
  • 15. 1. WikipediaWrote a Perl script to parse all tracklists and save to a database
  • 16. 1. Wikipediamap + grep + re + insert db
  • 17. 2.VK.comThere are all (or almost all) tracks and API on VKontakte!
  • 18. 2.VK.com Created a VK app,accessed audio files through the OAuth Authorization
  • 19. 2.VK.comWrote an ojo script to find links to all mp3 through API
  • 20. 2.VK.com API Limits: no parallel requestsand 100 requests per hour from one user
  • 21. 2.VK.comTrack search: corrected some tracks manually, umlauts and NFD (thanks to @nordicdyno)
  • 22. 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;
  • 23. 2.VK.comWith the same ojo wrote a downloader of mp3-files (in one stream, so not to cross the limits)
  • 24. 2.VK.com The only screw-up of ojo: all files are of the same length; solution:$ENV{MOJO_MAX_MESSAGE_SIZE} = 100*1024*1024
  • 25. 2.VK.com Downloaded over 650 tracks,no fun in listening to a local player...
  • 26. 3. Frodio.com Created a radiostation with a random playlist;a tiny bug: not all tracks contain correct ID3-tags
  • 27. 3. Frodio.com Wrote a script to edit tagsusing MP3::Tag (delete ID3v1, set ID3v2)
  • 28. 3. Frodio.comArtist — Track title [GH disc name]
  • 29. 3. Frodio.comTook two days to get a good radio — Radio Guitar Hero http://guitarhero.frodio.com
  • 30. Now Im kept abreast of all GH tracks
  • 31. Facebook EffectBut I felt lonely and posted to GH Facebook group about radio
  • 32. Facebook Effect2250+ Likes, 43 Shared, 76 Comments, 78 peak of online listeners
  • 33. Perl, Guitar Hero and Rock’n’Roll
  • 34. use Perl or die;
  • 35. Thanks! Anatoly SharifulinYAPC::Russia 2012