Last active
January 3, 2017 03:03
-
-
Save ggtmtmgg/f8efd2600333a835c936d250e484d891 to your computer and use it in GitHub Desktop.
Print lyrics on your terminal.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lyrics.rb | |
# Usage: ruby lyrics.rb maroon5 maps | |
require 'json' | |
require 'open-uri' | |
artist = ARGV[0] | |
title = ARGV[1] | |
api_url = 'http://lyric-api.herokuapp.com/api/find/%s/%s' | |
source_url = URI.escape(api_url % [artist, title]) | |
source_json = JSON.load(open(source_url)) | |
puts source_json['lyric'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment