Class: Mameclo::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/mameclo/cli.rb

Instance Method Summary collapse

Instance Method Details

#entry(number) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/mameclo/cli.rb', line 9

def entry(number)
  conn = Faraday.new(:url => "http://www.mameblo.com/entries/#{number}.json")
  response = conn.get
  body = JSON.parse(response.body)
  say("title:\n" + body['title'] + "\n\n")
  say("content:\n" + body['content'])
end