Upgrade to Pro — share decks privately, control downloads, hide ads and more …

itunes-client

 itunes-client

Ryo Katsuma

March 29, 2014
Tweet

More Decks by Ryo Katsuma

Other Decks in Technology

Transcript

  1. itunes-client
    Ryo Katsuma
    Tokyu Ruby Kaigi #07

    View Slide

  2. http://www.flickr.com/photos/koichiroo/9293622896/
    Ryo Katsuma
    @ryo_katsuma
    Engineer at COOKPAD Inc.

    View Slide

  3. http://www.flickr.com/photos/desarrollalatam/10271530923/
    Hack

    View Slide

  4. music
    http://www.gratisography.com/

    View Slide

  5. iTunes
    https://www.apple.com/itunes/

    View Slide

  6. iTunes meets
    https://www.apple.com/itunes/

    View Slide

  7. iTunes meets Ruby
    https://www.apple.com/itunes/

    View Slide

  8. to improve operability?
    https://www.apple.com/itunes/

    View Slide

  9. a new Ruby gem

    View Slide

  10. ɹitunes-client
    https://github.com/katsuma/itunes-client

    View Slide

  11. ɹitunes-client
    https://github.com/katsuma/itunes-client
    Demo

    View Slide

  12. Find tracks with some
    conditions by Ruby

    View Slide

  13. Find tracks with some
    conditions by Ruby
    itunes-client solves it

    View Slide

  14. Itunes::Track.find_by

    View Slide

  15. View Slide

  16. Play or Stop a track
    by Ruby

    View Slide

  17. Play or Stop a track
    by Ruby
    itunes-client solves it

    View Slide

  18. Itunes::Track#play

    View Slide

  19. Itunes::Track#pause

    View Slide

  20. Itunes::Track#stop

    View Slide

  21. View Slide

  22. Add a new file,
    and tag it by Ruby

    View Slide

  23. Add a new file,
    and tag it by Ruby
    itunes-client solves it

    View Slide

  24. Itunes::Player.add

    View Slide

  25. Itunes::Track#update

    View Slide

  26. View Slide

  27. tell application "iTunes"
    set specified_tracks to (every track whose #{conditions})

    end
    generate temporary
    AppleScript

    View Slide

  28. execute_out, process_status = ɹ
    ɹ*Open3.capture2("osascript #{script_path}")
    exec it by osascript

    View Slide

  29. Play a song
    stored at YouTube
    by iTunes

    View Slide

  30. Play a song
    stored at YouTube
    by iTunes
    itunes-client wrapper
    solves it

    View Slide

  31. ɹtaifu
    https://github.com/katsuma/taifu

    View Slide

  32. taifu http://youtube.com/watch?v=I1X6MrBfjrk

    View Slide

  33. Download by youtube-dl

    View Slide

  34. Download by youtube-dl
    Convert by ffmpeg

    View Slide

  35. Download by youtube-dl
    Convert by ffmpeg
    Add, encode and tag by itunes-client

    View Slide

  36. Automation is great

    View Slide

  37. http://www.flickr.com/photos/desarrollalatam/10271530923/
    happy music hack

    View Slide