Installation

# Add this to your shard.yml
dependencies:
  facebook:
    github: maiha/facebook.cr
    version: ~> 23.0.0

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
maiha <maiha@wota.jp>
Targets
  • fbget from samples/fbget.cr
  • facebook from src/cli/bin/facebook.cr
  • facebook-pb from src/cli/bin/facebook.cr
  • facebook-dev from src/cli/bin/facebook.cr
  • facebook-pb-dev from src/cli/bin/facebook.cr

Dependencies

Runtime Dependencies

Development Dependencies

  • cmds*github: maiha/cmds.crdev
  • opts*github: maiha/opts.crdev
  • shell*github: maiha/shell.crdev
  • clickhouse0.5.8github: maiha/clickhouse.crdev
  • toml-config0.6.1github: maiha/toml-config.crdev

README

# facebook.cr [![Build Status](https://travis-ci.org/maiha/facebook.cr.svg?branch=master)](https://travis-ci.org/maiha/facebook.cr)

facebook api for [Crystal](http://crystal-lang.org/).

## Usage (as Application)

Download the x86_64 static binary from [releases](https://github.com/maiha/facebook.cr/releases).

You can send an arbitrary GET request to the Facebook Marketing API.

```console
$ facebook api get '/v23.0/me' -a <ACCESS_TOKEN>
$ facebook api get '/v23.0/me/adaccounts -d fields=account_id,name' -a <ACCESS_TOKEN>
```

Access tokens and other information can be put together in a configuration file.

```console
$ facebook config sample > .facebookrc

$ vi .facebookrc
access_token    = "xxxxxx"

$ facebook api me
```

## Usage (as Library)

- crystal: 0.33.0

```crystal
require "facebook"

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

## Development

1. Add the dependency to your `shard.yml`:

```yaml
dependencies:
  facebook:
    github: maiha/facebook
    version: 23.0.0
```

2. Run `shards install`

## 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](https://github.com/maiha) - creator and maintainer