age-rs / libtwitch-rs

Twitch API library written in Rust
https://docs.rs/libtwitch-rs/
GNU Lesser General Public License v3.0
13 stars 3 forks source link

Get channel ID automatically with API call #3

Open simonsan opened 4 years ago

simonsan commented 4 years ago

We should get the channel ID automatically from the API with a client id

calvinbrown085 commented 4 years ago

@simonsan I see your link to the twitch API docs, but where do we want to do this at? https://github.com/simonsan/twitch_api/blob/master/src/channels.rs#L53

We should get back the entire model object here via the channel id.

calvinbrown085 commented 4 years ago

I'd be happy to work on this btw! I'm just a bit confused at what to do here :)

simonsan commented 4 years ago

The problem is that (afaik) you don't really get the channel id from Twitch, just the client id. This is also connected to #2. To fill out this gap and have all the credentials at one place I thought of this:

What are your thoughts about this?

calvinbrown085 commented 4 years ago

@simonsan Instead of a .json file could we make it a .toml to keep synonymous with other rust project configuration?

But other than that, that seems like a decent idea to me!

simonsan commented 4 years ago

@calvinbrown085 Change some things here in this repo and lavisheng was implementing import functions for toml files.You still in it to work on this? ;-)

calvinbrown085 commented 4 years ago

@simonsan Anyone else can work on it as well, I just got back from a trip so it's going to be a couple days before I get back to OS :)

simonsan commented 4 years ago

Example usage:

curl -H 'Accept: application/vnd.twitchtv.v5+json' \
-H 'Client-ID: uo6dggojyb8d6soh92zknwmi5ej1q2' \
-X GET https://api.twitch.tv/kraken/users?login=dallas,dallasnchains