Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ochiengotieno304/streamsb-ruby
Unofficial StreamSB Ruby Client
https://github.com/ochiengotieno304/streamsb-ruby
api-wrapper ruby
Last synced: 16 days ago
JSON representation
Unofficial StreamSB Ruby Client
- Host: GitHub
- URL: https://github.com/ochiengotieno304/streamsb-ruby
- Owner: ochiengotieno304
- License: mit
- Created: 2022-12-24T10:23:18.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-19T20:40:47.000Z (almost 2 years ago)
- Last Synced: 2024-12-17T06:32:44.552Z (about 1 month ago)
- Topics: api-wrapper, ruby
- Language: Ruby
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Streamsb Ruby Client
[![Gem Version](https://badge.fury.io/rb/streamsb.svg)](https://badge.fury.io/rb/streamsb)
## Installation
Install the gem and add to the application's Gemfile by executing:
bundle add streamsb
If bundler is not being used to manage dependencies, install the gem by executing:
gem install streamsb
Alternatively, you can opt for Github's installation, add this to your gem file:
gem 'streamsb', github: 'ochiengotieno304/streamsb-ruby'
## Usage
### Initialize Streamsb Client
```ruby
require "streamsb"@client = Streamsb::Client.new(api_key: ENV['STREAMSB_API_KEY'])
```Make API calls using the @client object
### 1. Account
#### 1.1 Info
```ruby
account_info = @client.account_info
```#### 1.2 Stats
```ruby
account_info = @client.account_stats
```### 2. File
#### 2.1 File Info
```ruby
file_info = @client.file_info(file_code)
```- `file_code`: file code `REQUIRED`
#### 2.2 Rename File
```ruby
rename_file = @client.rename_file(file_code, title, name)
```- `file_code`: file code `REQUIRED`
- `title`: new file title `REQUIRED`
- `name`: new file name `REQUIRED`#### 2.3 Clone File
```ruby
clone_info = @client.clone_file(file_code)
```- `file_code`: file code `REQUIRED`
#### 2.4 List Files
```ruby
file_list = @client.list_files(page, per_page, fld_id, is_public, created, title)```
- `page`: page number `OPTIONAL`,
- `per_page`: results per page `OPTIONAL`
- `fld_id`: folder id `OPTIONAL`
- `is_public`: show public (1) or private (0) files only `OPTIONAL`
- `created`: show only files uploaded after timestamp `OPTIONAL`
- `title`: filter video titles `OPTIONAL`#### 2.5 Get Direct All
```ruby
direct_all = @client.get_direct_all(file_code)
```- `file_code`: file code `REQUIRED`
#### 2.6 Get Direct Quality
```ruby
direct_quality = @client.get_direct_quality(file_code, quality)
```- `file_code`: file code `REQUIRED`
- `quality`: video quality if exist, possible values: `n` , `h` , `l` `OPTIONAL`### 2.7 Set Folder
```ruby
set_folder = @client.set_folder(file_code, folder_id)
```- `file_code`: file code `REQUIRED`
- `folder_id`: folder id `REQUIRED`## 3. Folder
### 3.1 List Files
```ruby
files = @client.folder_list(folder_id)
```- `folder_id`: folder id `REQUIRED`
### 3.2 Create Folder
```ruby
folder = @client.create_folder(name, folder_id)
```- `name`: folder name `REQUIRED`
- `folder_id`: parent folder id `OPTIONAL`## 4. Upload File
### 4.1 Get Server
```ruby
upload_server = @client.upload_server
```### 4.2 Upload File
> **Note:**
> Will be in later realeases## 5. Upload Url
### 5.1 Add Url
```ruby
url = @client.add_url(url)
```- `url`: upload url `REQUIRED`
### 5.2 List Url
```ruby
urls = @client.list_url
```### 5.3 Status
```ruby
status = @client.url_status(file_code)
```- `file_code`: file_code `REQUIRED`
### 5.4 Action
> **Note:**
> Will be in later releases## Contributing
Bug reports and pull requests are welcome on GitHub at . This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/ochiengotieno304/streamsb-ruby/blob/main/CODE_OF_CONDUCT.md).
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
## Code of Conduct
Everyone interacting in the Streamsb project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/ochiengotieno304/streamsb-ruby/blob/main/CODE_OF_CONDUCT.md).