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

Badge request: IRC channel name + user count #627

Open
andrewrk opened this issue Jan 6, 2016 · 17 comments
Open

Badge request: IRC channel name + user count #627

andrewrk opened this issue Jan 6, 2016 · 17 comments
Labels
service-badge New or updated service badge

Comments

@andrewrk
Copy link

andrewrk commented Jan 6, 2016

I'm not sure exactly what shields is, but this seems like a nice place to find out if anyone has already thought of / implemented this idea:

I'd like a shield that displays the IRC channel of my project, and tells the number of people that are currently in the channel. I think that would make it more likely for people to want to join and chat if they see that the room is not empty.

@hlandau
Copy link

hlandau commented Jan 17, 2016

This is an interesting idea, but difficult. In order to do this reasonably you'd need to find an existing IRC indexer with an API to expose this information. And as far as I'm aware, none exist. There are IRC indexers, but, as far as I'm aware, none with an API. Might be interesting to approach them and ask if they'd be interested in exposing one...

@AdrieanKhisbe AdrieanKhisbe added service-badge New or updated service badge feature-request labels Jan 25, 2016
@espadrine
Copy link
Member

That's a really nice idea, and I'd love to see it done. If we want to generalize to any IRC network, I'm not sure we can use HTTP.

Something as simple as this gives us the answer, if we parse it:

var net = require('net');
function getUsers(host, port, channel, cb) {
  var client = net.createConnection({host:host, port:port},
    function() {
      client.write('NICK shields\nUSER shields.io 8 * : shields\nJOIN ' + channel + '\n');
    });
  var data;
  client.on('data', function(buffer) {
    data += '' + buffer;
    // Parse the data.
    client.end();
  });
  client.on('end', function() { cb(data); });
}

getUsers('irc.freenode.net', 6667, '#ubuntu', function(data) {console.log(data)});

It is way too slow, will cause nick collisions, doesn't escape the channel name, and the IRC servers wouldn't be able to handle the load.

We would want to use a much more lightweight way to access that data. Ideally, we'd want to talk to Freenode about it, but their website does not present a way to contact them. I left an unmoderated comment on http://blog.freenode.net/2016/02/recent-events-and-future-changes, we'll see how things go.

@andrewrk
Copy link
Author

You don't have to join the room to get the user count. The LIST command returns a list of all channels with user count for each one.

You could have a single server do a LIST command on freenode every 5 minutes or so and then cache the results in a table.

@espadrine
Copy link
Member

I tried, but I didn't get any user. Do you have a minimal script similar to the one I wrote that produces that result?

@tunnckoCore
Copy link

tunnckoCore commented Apr 23, 2017

this is interesting idea, yea. And probably the url could be something like this

https://img.shields.io/irc/network-name/channel-name[/port].svg

e.g.

freenode irc tunnckoCore charlike channel

freenode irc tunnckoCore charlike channel

![](https://img.shields.io/badge/irc.freenode.net-%23charlike-blue.svg)

@andrewrk
Copy link
Author

I want to reiterate that printing the count of users in the channel would be likely to increase engagement.

@tunnckoCore
Copy link

tunnckoCore commented Apr 23, 2017

i think that there's no so much space. most important are the network and channel name. For me it can't be without network or channel.

Don't know, probably this seems okey too

freenode irc tunnckoCore charlike channel

but it's not clear nowadays that this is IRC channel "room" :D Once upon a time it was totally enough.

@koppor
Copy link

koppor commented Jan 12, 2018

I like the badge of @olstenlarck. Maye also IRC #charlike 331? - Not much more space, but clear that it is IRC.

@tunnckoCore
Copy link

@koppor agree :)

@paulmelnikow
Copy link
Member

It looks like we would need some help from Freenode on this. @koppor would you like to reach out to them?

@tunnckoCore
Copy link

@paulmelnikow why? @espadrine gives good example #627 (comment) which i believe will work.

@koppor
Copy link

koppor commented Jan 15, 2018

@paulmelnikow

I talked in #freenode on the Freenode IRC.

  • number of users is public information, so it is OK
  • no publishing of logs (joins, parts, ...)
  • no publishing of who is in the channel
  • in case the bots plan to join channels, they should get channel owner consent first

"basically: every piece of information that users could not gather from outside of the channel should not be published without channel owner consent"

@koppor
Copy link

koppor commented Jan 15, 2018

@olstenlarck I think, the above JavaScript statements do a) join a channel (which may be disallowed by channel operators as this is an automated operation) b) are only OK when executed on the shield servers in a cronjob and not on every request by a user.

@koppor
Copy link

koppor commented Jan 15, 2018

@paulmelnikow There is http://irc.netsplit.de/ with some user data; maybe, that can be used? (Even though, not all channels seem to be available here)

Example: http://irc.netsplit.de/channels/details.php?room=%23eclipse&net=freenode

http://irc.netsplit.de/channels/?chat=eclipse

grafik

@paulmelnikow
Copy link
Member

Is it possible that Freenode could add a separate API for this, maybe even an HTTP API?

@paulmelnikow paulmelnikow changed the title idea for a new shield: IRC channel name + user count Badge request: IRC channel name + user count Jan 28, 2019
@ssbarnea
Copy link

At this stage i would be glad to see even only a clickable URI link like irc:///#foo kind of badge, without any counting of users.

@graingert
Copy link

I'd like to see info from logbot.info eg: https://freenode.logbot.info/twisted-dev/stats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service-badge New or updated service badge
Projects
None yet
Development

No branches or pull requests

9 participants