Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Awesome Lists containing this project

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