Skip to content

A Simple Ruby script that creates an event for a group on Facebook and can be run on Heroku.

License

Notifications You must be signed in to change notification settings

okinawarb/fbevent-creator

Repository files navigation

Facebook Event Creator

fbevent-creator icon

Don't need to manually create periodical events any more.

Description

Facebook Event Creator is a Ruby script that creates events on Facebook, which can be run on Heroku. Using this script and Heroku, you can weekly create an Facebook event for a group. For example, Okinawa Ruby User Group, often called as Okinawa.rb, holds a weekly meetup in its Facebook Group. And the event is automatically created by this scrip running on Heroku.

Requirements

How to Use

  1. Download this source code: git clone git://github.com/yasulab/fbevent-creator.git
  2. Rename config.yml.sample to config.yml and set your own information.
  3. Create a Facebook App w/ create_event permission, which creates an event instead of you.
  4. Set its Access Token of to config.yml.
  5. Check if it works correctly by running test script: ruby test-facebook-api.rb.
  6. Now, you can create an event via the script by: ruby fbevent-creator.rb
  7. (Option) If you upload this script to Heroku and install Heroku Scheduler, you'll able to periodically create Facebook event.

How to Activate your Facebook App

  1. Create an Facebook App and get its Client ID (If you don't know of it, visit here).

  2. Replace the following URI's YOUR_APP_ID with yours.

    https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&scope=create_event&redirect_uri=https://www.facebook.com/connect/login_success.html&response_type=token

  3. Access the URI with your web browswer, and note the following XXXX value in the result.

    https://www.facebook.com/connect/login_success.html#access_token=XXXX&expires_in=YYYY

  4. Replace YOUR_ACCEES_TOKEN in config.yml (or config.yml.sample) with XXXX that you noted.

  5. Done!

How to Extend your Access Token

  1. Visit here and click Debug button next to your app's User Token.

  2. Check if Expires is close to now. If not, skip this section (re-visit this section when it's close).

  3. If close, replace APP_ID, APP_SECRET, and ACCESS_TOKEN with yours.

    https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=fb_exchange_token&fb_exchange_token=ACCESS_TOKEN

  4. Visit the replaced URL with your web browser.

  5. If it works correctly, you'll see something like this:

    access_token=YOUR_ACCESS_TOKEN&expires=EXPIRED_DATE

  6. Visit Debugger Tool and type YOUR_ACCESS_TOKEN above.

  7. Check Expired: and if it's in about 2months, you've successfully extended the token, yay!

Developers

@yasulab, @hanachin_

Sample Usecase

With this script and Heroku, you can periodically create Facebook events like this:

License

Any resources included in this repository are under MIT License.

About

A Simple Ruby script that creates an event for a group on Facebook and can be run on Heroku.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages