facebook api for Crystal.
Download the x86_64 static binary from releases.
You can send an arbitrary GET request to the Facebook Marketing API.
$ facebook api get '/v19.0/me' -a <ACCESS_TOKEN>
$ facebook api get '/v19.0/me/adaccounts -d fields=account_id,name' -a <ACCESS_TOKEN>
Access tokens and other information can be put together in a configuration file.
$ facebook config sample > .facebookrc
$ vi .facebookrc
access_token = "xxxxxx"
$ facebook api me
- crystal: 0.33.0
require "facebook"
client = Facebook::Client.new(auth: "xxxxxx")
res = client.get("/me")
puts res.body
- Add the dependency to your
shard.yml
:
dependencies:
facebook:
github: maiha/facebook
version: 19.0.0
- Run
shards install
- Fork it (https://github.com/maiha/facebook.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- maiha - creator and maintainer