diff --git a/README.md b/README.md index e9317b2..5146644 100644 --- a/README.md +++ b/README.md @@ -73,17 +73,6 @@ Once you've submitted a PR, it will automatically be deployed to (PR#).pr.zeus.g Analytics are powered by [Fathom](https://usefathom.com) and are available on . These are only available to administrators with proper rights. These analytics are self hosted and provide only simple statistics for our information, without breaching your privacy. -## Import event from Facebook - -You can import events from Facebook with `bundle exec nanoc fetch #{event_id}`. -You will need to create a `.fb_token` file and request an API token to put in there, see [FB graph API](https://developers.facebook.com/tools/explorer/). - -You will probably need to make a new app (see navbar, it's quite trivial), unless you already have a Zeus site app. - -You need to create a User Token with `user_events` permission. - -We currently request from v2.10, details about the code can be found in [./commands/fetch]. - ## Built With * [nanoc](https://github.com/nanoc/nanoc), static site generator diff --git a/commands/fetch.rb b/commands/fetch.rb deleted file mode 100644 index 6e8d804..0000000 --- a/commands/fetch.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'net/http' -require 'json' - -usage 'fetch [facebook event id]' -aliases :f -summary 'Fetch an event from facebook' -description 'Fetch an event from facebook' - -run do |_opts, args, _cmd| - fb_token = File.read('.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: #Fill in - time: #{o['start_time']} - end: #{o['end_time']} - location: #{o['place']['name']} - banner: #{o['cover']['source']} - created_at: #Fill in - facebook: 'https://www.facebook.com/events/#{event_id}/' - --- - - #{o['description']} - EOS -end