Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sledgang/twitch
Twitch API binding in Crystal
https://github.com/sledgang/twitch
api crystal irc twitch
Last synced: 26 days ago
JSON representation
Twitch API binding in Crystal
- Host: GitHub
- URL: https://github.com/sledgang/twitch
- Owner: sledgang
- License: mit
- Created: 2017-06-07T19:27:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-20T18:06:45.000Z (about 5 years ago)
- Last Synced: 2024-08-03T13:01:49.102Z (4 months ago)
- Topics: api, crystal, irc, twitch
- Language: Crystal
- Size: 63.5 KB
- Stars: 5
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-twitch-dev - sledgang/twitch - Twitch API binding in Crystal. (Libraries / Crystal)
README
# twitch
A binding to the [Twitch API](https://dev.twitch.tv/docs) implemented in [Crystal](https://crystal-lang.org/).
### WIP - Still under heavy design/development!
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
twitch:
github: y32/twitch
```## Usage
There are several main components to the library:
- `Twitch::Kraken` - Client for interacting with Twitch's REST API
```crystal
require "twitch/kraken"twitch = Twitch::Kraken.new(token: "cfabdegwdoklmawdzdo98xt2fo512y")
```Refer to the documentation for the kinds of requests you can make with this client.
- `Twitch::IRC` - Client for building IRC applications
```crystal
require "twitch/irc"bot = Twitch::IRC.new(nick: "nekka", token: "cfabdegwdoklmawdzdo98xt2fo512y")
# Create a handler to process incoming messages
bot.on_message do |message|
# handle this message
end# Connect to Twitch
bot.run!
```## Contributors
- [Daniel-Worrall](https://github.com/Daniel-Worrall) - creator, maintainer, spec-man extraordinaire
- [snapcase](https://github.com/snapcase) - creator, maintainer, IRC expert
- [z64](https://github.com/z64) - creator, maintainer, script kiddie