Skip to content
Facebook Ads API for crystal. Since this is alpha stage, the proto schema may be updated without compatibility.
Crystal TSQL Makefile
Branch: master
Clone or download
Latest commit 5ce8cf8 Sep 15, 2019

README.md

facebook.cr Build Status

facebook api for Crystal.

  • crystal: 0.30.0

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 '/v4.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.3
  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

  • maiha - creator and maintainer
You can’t perform that action at this time.