Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

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

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Próximo SlideShare
Audio on the web
Audio on the web
Cargando en…3
×

Eche un vistazo a continuación

1 de 41 Anuncio

Más Contenido Relacionado

Anuncio

Más de Anatoly Sharifulin (20)

Más reciente (20)

Anuncio

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

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

×