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.
- Ruby 1.9.3
- RubyGems: koala
- (Option) Heroku + Heroku Scheduler
- Download this source code:
git clone git://github.com/yasulab/fbevent-creator.git
- Rename
config.yml.sample
toconfig.yml
and set your own information. - Create a Facebook App w/
create_event
permission, which creates an event instead of you. - Set its Access Token of to
config.yml
. - Check if it works correctly by running test script:
ruby test-facebook-api.rb
. - Now, you can create an event via the script by:
ruby fbevent-creator.rb
- (Option) If you upload this script to Heroku and install Heroku Scheduler, you'll able to periodically create Facebook event.
-
Create an Facebook App and get its Client ID (If you don't know of it, visit here).
-
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
-
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
-
Replace
YOUR_ACCEES_TOKEN
inconfig.yml
(orconfig.yml.sample
) withXXXX
that you noted. -
Done!
-
Visit here and click
Debug
button next to your app'sUser Token
. -
Check if
Expires
is close to now. If not, skip this section (re-visit this section when it's close). -
If close, replace
APP_ID
,APP_SECRET
, andACCESS_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
-
Visit the replaced URL with your web browser.
-
If it works correctly, you'll see something like this:
access_token=YOUR_ACCESS_TOKEN&expires=EXPIRED_DATE
-
Visit Debugger Tool and type
YOUR_ACCESS_TOKEN
above. -
Check
Expired:
and if it'sin about 2months
, you've successfully extended the token, yay!
With this script and Heroku, you can periodically create Facebook events like this:
Any resources included in this repository are under MIT License.