Skip to content

Instantly share code, notes, and snippets.

@ggtmtmgg
Last active January 3, 2017 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ggtmtmgg/f8efd2600333a835c936d250e484d891 to your computer and use it in GitHub Desktop.
Save ggtmtmgg/f8efd2600333a835c936d250e484d891 to your computer and use it in GitHub Desktop.
Print lyrics on your terminal.
# 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