fburl.cr v0.6.0

fburl is a Twurl clone for Facebook

fburl.cr Build Status

fburl is a Twurl clone for Facebook.

  • alpha stage: Support only system user.

Features

similar

  • commands: request, alias
  • implements: command pattern with controller

dialect

  • config: use TOML format rather than YAML

Installation

Static Binary is ready for x86_64 linux

Compile from source / Use as Crystal library

Usage

config

% fburl config init
% vi ~/.fburlrc     # set access_token

basic

% fburl /me      # perform the GET request
% fburl /me -D - # dump header like cURL
  • TODO: now support only GET method

paging

If -r option is given, client automatically follows next link until the page count reaches --max-next (default: 15).

% fburl /...    | jq '.data|length'  # => 25
% fburl /... -r | jq '.data|length'  # => 128

dryrun

% fburl /me -n      # print curl command 
% fburl /me -n | sh # run it

Example

1. get my account_id

$ ./fburl /me
{
  "name": "...",
  "id": "123456"
}

2. get User Adaccounts

  • /v4.0/<USER_ID>/adaccounts
$ ./fburl /v4.0/123456/adaccounts
[
  {
    "account_id": "212345",
    "id": "act_212345"
  },
...

same as /v4.0/me/adaccounts

$ ./fburl /v4.0/me/adaccounts -d fields=account_id,name -d limit=3

3. get campaigns

$ ./fburl /v4.0/act_212345/campaigns
[
  {
    "id": "312345"
   },
...

4. get Campaign Ads

$ ./fburl /v4.0/312345/ads
[
  {
    "id": "412345"
  },
...

5. get adcreativs

$ ./fburl /v4.0/act_212345/adcreatives
[
  {
    "id": "512345"
   },
...

Roadmap

v1.0.0

  • Command : Account
  • Command : Alias(basic)
  • Command : Alias(placeholder)
  • Command : Authorization(support user account)
  • Command : Config
  • Command : Request(GET)
  • Command : Request(POST)
  • Command : Request(BATCH)
  • Command : Request(curl)
  • Library : execute returns HTTP::Client::Response
  • Client : Paging

Contributing

  1. Fork it ( https://github.com/maiha/fburl.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 maiha - creator, maintainer
Repository

fburl.cr

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 3
  • over 4 years ago
  • October 4, 2017
License

MIT License

Links
Synced at

Sun, 05 May 2024 19:49:15 GMT

Languages