facebook.cr Build Status

facebook api for Crystal.

Usage (library)

require "facebook"

client = Facebook::Client.new(auth: "xxxxxx")
res = client.get("/me")
puts res.body

Usage (facebook application)

setup config (first time only)

Generate sample by config, then set access_token. That's all.

$ facebook config sample > .facebookrc
$ vi .facebookrc
access_token    = "xxxxxx"

You can verify the access_key by invoking api me.

$ facebook api me

api

builtin api commands

Just run facebook api to show all available api commands.

$ facebook api
[possible tasks]
  adaccounts, get, me
...

$ facebook api adaccounts

get is meta api commands that can invoke arbitrary commands by string.

$ facebook api get '/v6.0/me/adaccounts -d fields=account_id,name'

Development

  1. Add the dependency to your shard.yml:
dependencies:
  facebook:
    github: maiha/facebook
    version: 0.4.9
  1. Run shards install

Development

TODO Write development instructions here

Contributing

  1. Fork it (https://github.com/maiha/facebook.cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors