Sha256: 8327794e187bb02d1ef027f6b6f7a9d6c54ef93c7bb9fb1306d95f325af69a35

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 KB

Contents

# DouyinSdk

Douyin SDK for Ruby

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'douyin_sdk'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install douyin_sdk

## Usage
1.配置 ClientKey 和 ClientSecret

```ruby
$client = DouyinSdk::Client.new(client_key, client_secret)
```

* 抖音Oauth 2授权
    
1.获取用户授权链接:
```ruby
$client.auth_code_url(redirect_uri, scope)
```
  reirect_url为回调接收地址,scope为要获取的权限,详见官方文档
  
2.用户扫码授权后,根据code获取用户access_token,open_id和refresh_token等信息
```ruby
$client.access_token(code)
```

* 刷新access_token

```ruby
$client.refresh_token(refresh_token)
```

* 获取用户公开信息

```ruby
$client.user_info(access_token, open_id)
```

* 获取粉丝列表(需要在开放平台申请用户管理接口权限)

```ruby
$client.fan_list(access_token, open_id)
```
* 查询授权账号视频数据

```ruby
$client.video_list(access_token, open_id)
```

* 查询指定视频数据

    item_id为抖音视频id
```ruby
$client.video_data(access_token, open_id, item_id)
```
## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/dhuSaverin/douyin_sdk. This project is intended to be a safe, welcoming space for collaboration.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
douyin_sdk-0.1.4 README.md
douyin_sdk-0.1.0 README.md