Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer #18

Open
frct1 opened this issue Aug 22, 2018 · 7 comments
Open

Viewer #18

frct1 opened this issue Aug 22, 2018 · 7 comments

Comments

@frct1
Copy link

frct1 commented Aug 22, 2018

Hi, @schroffl. Do you consider an idea to create server viewer (clientlist and channellist), for example in JSON and html format.
I found one , but it's seems shitty.
For example: query.viewer(format:"json") which returning html or json builded server tree with clients, channels etc

@schroffl
Copy link
Owner

If I understand you correctly you want to be able to get an html-formatted overview that you can e.g. embed in your website?

@frct1
Copy link
Author

frct1 commented Aug 22, 2018

Yes that is. Building public api for ts users and it will usefull feature

@schroffl
Copy link
Owner

I don't think this is a good addition to this library, because it would clutter the API with functions that probably only very few people use. It would make more sense to create a separate package for this.

@frct1
Copy link
Author

frct1 commented Aug 28, 2018

@schroffl That should be very cool with using like teamspeak-filesystem package

@schroffl
Copy link
Owner

What exactly do you mean? I don't really get how the HTML-formatted client-/channellist would be useful for the filesystem? Sorry if I misunderstood something ^^

@frct1
Copy link
Author

frct1 commented Aug 28, 2018

Oh, my english still so bad...
Something like that

let teamspeakViewer=require('teamspeak-viewer');
let query=new TeamspeakQuery.Raw(*connection data*);
let viewer=teamspeakViewer(query);
console.log(viewer.json());
console.log(viewer.html());

@schroffl
Copy link
Owner

If you want you can try to build such a package yourself, because I currently don't have the time. And besides, it's a useful learning experience :)

Also: I would just keep it a simple function that takes the client-/channelist output and builds the desired output, e.g. like this:

const viewer = require('teamspeak-viewer');

query.send('clientlist')
  .then(viewer.html)
  .then(html => { /* Do whatever you want with your html */ });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants