diff --git a/commands/fetch.rb b/commands/fetch.rb index b63a3d2..eb4c6e3 100644 --- a/commands/fetch.rb +++ b/commands/fetch.rb @@ -10,16 +10,19 @@ description 'Fetch an event from facebook' run do |_opts, args, _cmd| fb_token = File.read('.fb_token') - uri = URI("https://graph.facebook.com/v2.10/#{args[0]}?fields=cover,name,description,start_time,place,end_time&access_token=#{fb_token}") + event_id = args[0] + uri = URI("https://graph.facebook.com/v2.10/#{event_id}?fields=cover,name,description,start_time,place,end_time&access_token=#{fb_token}") o = JSON.parse(Net::HTTP.get(uri)) - puts <<~EOS --- title: "#{o['name']}" + description: #TODO time: #{o['start_time']} - location: #{o['place']['name']} end: #{o['end_time']} + location: #{o['place']['name']} banner: #{o['cover']['source']} + created_at: #TODO + facebook: 'https://www.facebook.com/events/#{event_id}/' --- #{o['description']}