fburl.cr v0.6.0
fburl.cr
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
- See README.cr.md
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
GET /v4.0/{ad-account-id}/campaigns HTTP/1.1
- https://developers.facebook.com/docs/marketing-api/reference/ad-account/campaigns/
$ ./fburl /v4.0/act_212345/campaigns
[
{
"id": "312345"
},
...
4. get Campaign Ads
GET /v4.0/{campaign-id}/ads HTTP/1.1
- https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/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
returnsHTTP::Client::Response
- Client : Paging
Contributing
- Fork it ( https://github.com/maiha/fburl.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
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