These are chat archives for dcsan/gitterbot

25th
Aug 2015
dc
@dcsan
Aug 25 2015 02:27
no there's not much new changes so no reason to deploy atm.
DTing
@dting
Aug 25 2015 02:31
quincy just noticed the "controller" feature
CamperBot
@camperbot
Aug 25 2015 02:31
:trollface: troll problems? notify admins here
Abhisek Pattnaik
@abhisekp
Aug 25 2015 05:05
@dcsan what about the joining 400+ rooms? Won't that be deployed.
dc
@dcsan
Aug 25 2015 06:55
is that working?
i'm buried in another project and need to find time to revisit everything on CBot soon
I'd rather do it when there's something substantial to add ...
Abhisek Pattnaik
@abhisekp
Aug 25 2015 06:56
@dcsan you've to test that 400+ thing. It's huge.
dc
@dcsan
Aug 25 2015 06:56
it takes as much time to mess around for nothing as for a whole bunch of features together. still needs the same amount of testing etc
most of those rooms don't have much traffic
you know one thing that would be really cool to add and quite easy -
google analytics
Abhisek Pattnaik
@abhisekp
Aug 25 2015 06:56
but how?
from node
each time a chat is called, ping GA
then we'd get some stats on usage in different channels
Abhisek Pattnaik
@abhisekp
Aug 25 2015 06:57
yeah! That would be really great. :)
dc
@dcsan
Aug 25 2015 06:57
i guess its not going to affect what we do that much ...
but ther's a quiz feature i was hopign to work on
so seeing stats on usage before and after would be really interesting
Abhisek Pattnaik
@abhisekp
Aug 25 2015 06:58
is there an issue open for adding GA?
dc
@dcsan
Aug 25 2015 06:58
or seeing which bonfire rooms are being used the most etc.
no
just was thinking bout it
Abhisek Pattnaik
@abhisekp
Aug 25 2015 06:58
stats r always helpful.
Is it the best option available?
dc
@dcsan
Aug 25 2015 06:58
its free
using that on another project but its nothing special
lots other analytics better than google but not free
eg mixpanel / https://keen.io/
Abhisek Pattnaik
@abhisekp
Aug 25 2015 06:59
we need only the free ones. :)
is cool bu talso expensvie
yeah, so its GA
Abhisek Pattnaik
@abhisekp
Aug 25 2015 07:01
:+1:
dc
@dcsan
Aug 25 2015 07:06
something you feel like doing?
then i'll deploy the other stuff together :)
Abhisek Pattnaik
@abhisekp
Aug 25 2015 07:08
@dcsan i've to look into & c if i can do. :)
@dcsan sometimes I feel afraid to do something. E.g. i'm on Zipline and i'm feeling afraid to do the Personal Portfolio. :(
DTing
@dting
Aug 25 2015 07:16
@abhisekp do eet
dc
@dcsan
Aug 25 2015 07:16
just make sure to add any GA account info to the dot.env file
and not hardwired into the source
also use the async method .send() for the data (i think its the only way anyway)
Abhisek Pattnaik
@abhisekp
Aug 25 2015 07:17
@dcsan yep! I would never ever risk such an important info to be public. :P
evaristoc
@evaristoc
Aug 25 2015 14:53
@dcsan and @abhisekp : google analytics is something I can help if you are looking for extra hands... this is more about my "territory"... let me know
Abhisek Pattnaik
@abhisekp
Aug 25 2015 17:06
@evaristoc sure. Feel free to help. dcsan/gitterbot#169
@evaristoc shall I assign you in the issue pg.?
evaristoc
@evaristoc
Aug 25 2015 17:38
@abhisekp thanks! Let's agree... I will rather follow your lead as I am following the gitterbot issues but I am not fully involved in the development.
@abhisekp If you think assigning can help? Then sure!
CamperBot
@camperbot
Aug 25 2015 17:38
evaristoc sends brownie points to @abhisekp and @abhisekp :sparkles: :thumbsup: :sparkles:
:star: 294 | @abhisekp | http://www.freecodecamp.com/abhisekp
:warning: evaristoc already gave abhisekp points
evaristoc
@evaristoc
Aug 25 2015 17:38
@abhisekp I am checking the issue and keep you informed
Abhisek Pattnaik
@abhisekp
Aug 25 2015 17:40
@evaristoc @dcsan is the higher power here. :) He is the creator.
@evaristoc if you need any clarification, @dcsan can help you but he is bit busy these days.
@evaristoc though all other contributors might help too. :)
So feel free to ask and contrib. Cheers :beer:
evaristoc
@evaristoc
Aug 25 2015 17:43
Ok... yes, I was reading your communications (... being a snoopy... :smile: )
Abhisek Pattnaik
@abhisekp
Aug 25 2015 17:48
@evaristoc one more issue found now. :P #170
evaristoc
@evaristoc
Aug 25 2015 18:02
hehehe!
Abhisek Pattnaik
@abhisekp
Aug 25 2015 18:04
@evaristoc thanks to you. :)
CamperBot
@camperbot
Aug 25 2015 18:04
abhisekp sends brownie points to @evaristoc :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for evaristoc
dc
@dcsan
Aug 25 2015 18:23
@evaristoc if you can look at GA integration that would be great
actually writing the code right? not setting up the dashboard etc so much...
#169 is the ticket
Abhisek Pattnaik
@abhisekp
Aug 25 2015 18:25
@dcsan I think @evaristoc means to write code :P
Not setup dashboard. :D
evaristoc
@evaristoc
Aug 25 2015 18:25

@dcsan: I will give a hand to @abhisekp with installing a tracking system (#169);

I was reading https://www.npmjs.com/package/universal-analytics; I also found an UUID ("googleTrackingId":"UA-XXXX-1") which I think it is Gitter's property which it is running for all gitter.

I was planning to ask at developers. What do you think?

In the meantime, @abhisekp and @cdsan... it is likely that I will be following the activity as well in the DataScience project...

dc
@dcsan
Aug 25 2015 18:25
ok so please go ahead
do you know a lot about GA then?
i did actually try to add it to another project last night
but events aren't showing up
i wonder if its something with how i am sending/tracking the userIDs
since google has that big disclaimer that "you won't send unique info"
and i am doing exactlyt hat :/
maybe the ID has to be turned into a long key ...
{strictCidFormat: false}
yeh, forgot to do that.
Abhisek Pattnaik
@abhisekp
Aug 25 2015 18:27
@evaristoc hey! it's dcsan not cdsan
evaristoc
@evaristoc
Aug 25 2015 18:29
@dcsan I have been more working at the user interface... :/
I am more an analyst...
Abhisek Pattnaik
@abhisekp
Aug 25 2015 18:29
@evaristoc :(
@dcsan you're always right. :clap:
evaristoc
@evaristoc
Aug 25 2015 18:30
@abhisekp hehehe!
Rex Schrader
@SaintPeter
Aug 25 2015 19:05
botstatus
CamperBot
@camperbot
Aug 25 2015 19:05
All bot systems are go!
botVersion: 0.0.11
env: prod
botname: camperbot
evaristoc
@evaristoc
Aug 25 2015 19:08

moving the note to the issue

In the meantime, @abhisekp if you have some specific rooms you want to follow we are working on an exercise at the DataScience room... We were asked by Quincy to add all rooms... If you want details I can comment the project in a DM... @dcsan is also in the DataScience room list...

Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:09
@evaristoc i guess any issue related notes must be written as a comment in the issue pg.
@evaristoc By "add all rooms", if you mean add all rooms to camperbot on join, that's already done. #148
@evaristoc but could you please test it using your own demobot?
evaristoc
@evaristoc
Aug 25 2015 19:24
@abhisekp actually I was referring to another exercise we are carrying out at the DataScience room... we are trying to replicate tiny things of the camperbot code to include in that project (we don't currently code as you do and besides we keep consistency by doing so...). Our plan was already to include some statistics to benefit the camperbot and FCC as a whole...
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:25
@evaristoc gr8 to see contributions from various fields. :)
nice :+1:
evaristoc
@evaristoc
Aug 25 2015 19:27
Let's see how it goes... @abhisekp please add yourself to the room? Any interests or comments coming from you as participant in the gitterbot will be more than welcome and useful; we have weekly reports to keep everyone updated of progress
Rex Schrader
@SaintPeter
Aug 25 2015 19:28
@dcsan Bot is currently not working in HelpBonfires, although it is working in other rooms. Odd.
CamperBot
@camperbot
Aug 25 2015 19:28
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
Rex Schrader
@SaintPeter
Aug 25 2015 19:28
@abhisekp I guess we need to improve the bonfires regex
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:29
oops!
evaristoc
@evaristoc
Aug 25 2015 19:29
@SaintPeter and @abhisekp is the real-time implementation still on plan? Or is it already implemented?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:29
@evaristoc realtime implementation of ???
Rex Schrader
@SaintPeter
Aug 25 2015 19:30
@evaristoc I guess it requires a major rewrite, so it's not in the cards for the short term
dc
@dcsan
Aug 25 2015 19:33
you mean the API shift? its not a huge task but probly a couple days
evaristoc
@evaristoc
Aug 25 2015 19:33
@SaintPeter I wonder if the current poor performance of the camperbot in the HelpBonfires room wouldn't be related to hitting the limit... May I question if you are using different tokens for several calls?
CamperBot
@camperbot
Aug 25 2015 19:33
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
dc
@dcsan
Aug 25 2015 19:33
it went down earlier today i just rebooted
evaristoc
@evaristoc
Aug 25 2015 19:33
@dcsan and @SaintPeter ok
Rex Schrader
@SaintPeter
Aug 25 2015 19:33
@dcsan Thanks
CamperBot
@camperbot
Aug 25 2015 19:33
saintpeter sends brownie points to @dcsan :sparkles: :thumbsup: :sparkles:
:star: 95 | @dcsan | http://www.freecodecamp.com/dcsan
evaristoc
@evaristoc
Aug 25 2015 19:34
Ahh... sorry, @SaintPeter: I didn't know it was not working at all... I missed something in your inquiry
dc
@dcsan
Aug 25 2015 19:34
not sure why it didnt reboot, i have it setup with pm2
its been running pretty well for a week or so without me touching it.
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:34
that's the real beauty of a s/w
Rex Schrader
@SaintPeter
Aug 25 2015 19:35
What is odd is that it's working in other rooms
I went around and did botstatus on the other rooms
but just not in HelpBonfires
CamperBot
@camperbot
Aug 25 2015 19:35
type bonfire name to get some info on that bonfire. And check HelpBonfires chatroom
evaristoc
@evaristoc
Aug 25 2015 19:36
botstatus
CamperBot
@camperbot
Aug 25 2015 19:36
All bot systems are go!
botVersion: 0.0.11
env: prod
botname: camperbot
Rex Schrader
@SaintPeter
Aug 25 2015 19:36
Also, grr, gotta fix the regex to be /\bbonfires?\b/
We need an uptime indicator in the botstatus
dc
@dcsan
Aug 25 2015 19:36
orly?
Rex Schrader
@SaintPeter
Aug 25 2015 19:36
Sure :D
abhisekp @abhisekp wonders why ppl type bonfires instead of bonfire
Rex Schrader
@SaintPeter
Aug 25 2015 19:37
rooms
CamperBot
@camperbot
Aug 25 2015 19:37

rooms

See all the FreeCodeCamp rooms at gitter.im/FreeCodeCamp/rooms
Or check this wiki article for a shortlist
Rex Schrader
@SaintPeter
Aug 25 2015 19:38
Is there a command that @camperbot will tell us all of the rooms it is active in?
evaristoc
@evaristoc
Aug 25 2015 19:38
@SaintPeter Does the camperbot know is active?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:39
@SaintPeter i think that rooms command was changed
evaristoc
@evaristoc
Aug 25 2015 19:39
An automatic ping?
Rex Schrader
@SaintPeter
Aug 25 2015 19:39
@evaristoc August 25th, 2015 - camperbot becomes sentient
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:39
lolz :D
evaristoc
@evaristoc
Aug 25 2015 19:40
(@SaintPeter: yes: it is a secret mission...)
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:40
I :heartpulse: this face. How did you achieve that?
dc
@dcsan
Aug 25 2015 19:40
i haven't deployed since rel 011
dcsan/gitterbot#171
there are a lot of changes comapred with master tho..
@SaintPeter there was but i think i removed it
    // TODO - sort alphabetically
    rooms: function (input, bot) {
        var uri, link, str, roomNames, icon;
        var baseList = RoomData.rooms();   // bot.roomList doesnt show private / meta data

        // https://gitter.im/FreeCodeCamp
        str = "## rooms\nSee all the FreeCodeCamp rooms at [gitter.im/FreeCodeCamp/rooms](https://gitter.im/orgs/FreeCodeCamp/rooms)\n"
        //
        //roomNames = baseList.map(function (rm) {
        //    clog("room", rm);
        //    if (rm.private) {
        //        return "----";
        //    } else {
        //        uri = "https://gitter.im/" + rm.name;
        //        icon = ":" + (rm.icon || "speech_balloon") + ":";
        //        link = "\n " + icon + " [" + rm.name + "](" + uri + ")";
        //        return link;
        //    }
        //});

        //trim so we dont get banned
        //roomNames = roomNames.slice(0, AppConfig.MAX_WIKI_LINES);
        //str += roomNames.join(" ");
        str += "Or check [this wiki article](https://github.com/freecodecamp/freecodecamp/wiki/official-free-code-camp-chat-rooms) for a shortlist"
        return str;
    },
and replaced with a wiki page
since all the rooms was a bit messy
also its not guaranteed we're "in" them according to gitter API
just that we tried to join em...
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:42
@dcsan that's the reason for automatic ping. :)
Rex Schrader
@SaintPeter
Aug 25 2015 19:42
@abhisekp Well, you see, when a mommy and a daddy love each other very much . . . ;)
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:42
@SaintPeter :D
Rex Schrader
@SaintPeter
Aug 25 2015 19:44
@dcsan Does the gitter API allow you to see if you succeeded in joining a channel?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:44
@dcsan does gitter API allow to get a list of room members?
I guess, it should.
@SaintPeter i think that's one way to know. :point_up: August 26, 2015 1:14 AM
Abhisek Pattnaik
@abhisekp
Aug 25 2015 19:52

@dcsan can you resolve the conflicts for #171 ?

This branch has conflicts that must be resolved.

@dcsan trying to see the files changed at https://github.com/dcsan/gitterbot/pull/171/files
Do you now realize how important #163 and #165 are?
evaristoc
@evaristoc
Aug 25 2015 20:03

@abhisekp and @SaintPeter In my opinion: One (still incomplete way) to verify if working is following what @abhisekp : actually, you just need to get the last message that the bot gave (the "All bot systems are go!...") and try to get the time the ping was sent and the time the message was created. But with no guarantee of entry, there is no guarantee of answer...

With that format, other current problem is the API limit... Better a priority schedule, randomisation and samples (not all, but just some), depending of activity...

People, leaving: have to work on the other projects... @abhisekp we are scheduling weekly reports in DataScience, again: you are welcome to give your views... I will keep an eye into the GA and also check if I can eventually help with testing... I am interested in the solved "all rooms" code; let you know?
dc
@dcsan
Aug 25 2015 20:26
@SaintPeter @abhisekp this is a patch to just stagger the room join joins
dcsan/gitterbot@dbef779
seems to be working
Rex Schrader
@SaintPeter
Aug 25 2015 20:26
Awesome, you're the man now @dcsan
dc
@dcsan
Aug 25 2015 20:26
and that will scale up to us adding any more rooms we want
its not the new API its just a hack but fixes up what we need for now
server takes ~2 mins to join all the rooms each restart but thats no big deal
it joins bonfires first
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:27
@dcsan i think it shud join official rooms first
dc
@dcsan
Aug 25 2015 20:28
ok well feel free to make a PR
but just one and one comment
i dont want to have to wade through 50 emails again for a text edit
Rex Schrader
@SaintPeter
Aug 25 2015 20:29
@dcsan Sorry you gotta work with all us noobs - that's what comes with free "help" ;)
@SaintPeter lolz :D
SaintPeter @SaintPeter jumps up and down "I'm helping, I'm helping!"
dc
@dcsan
Aug 25 2015 20:31
=======
// TODO - probably easier to refactor these as an array of entries
// since we aren't using the title/icon etc fields anymore
>>>>>>> rel-012

var BotRoomData = {

    // this controls which rooms you can access
    YOUR_GITHUB_ID: [
        // change this to be a room your user is already in
        {
            title: "bothelp",
            name: "YOUR_GITHUB_ID/testing",
            icon: "question",
some reason i have a conflicted file
OK cant deal with this atm
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:31
@dcsan yeah! becoz you've already merged my PR
@dcsan did you forget about merging that camperbot room addition PR?
dc
@dcsan
Aug 25 2015 20:34
yes
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:37

@dcsan here is the list of rooms camperbot joins for good from top to bottom

1. camperBotChatRooms
2. fccChatRooms.officialChatRooms
3. fccChatRooms.cityChatRooms
4. fccChatRooms.casualChatRooms
5. otherChatRooms

I've kept camperBot rooms first bcoz if any issues occur, camperbot admins should be able to debug them in the camperbot rooms.

@dcsan Is this a good maintainable JS or do I need more improvements? Any suggestions?
https://github.com/abhisekp/gitterbot/blob/4c6df75f2ec724f26c4889a9950e6bd3e4ec8af1/nap/data/RoomData.js
Could you please go through the whole file?
dc
@dcsan
Aug 25 2015 20:47
did you send a PR? did i merge it?
not sure why you need map AND reduce to insert the names?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:47
@dcsan that's what I've been saying all along. :)
dc
@dcsan
Aug 25 2015 20:47
// @TODO Refactor into a room generator function
var camperBotRooms = [
    camperBotChatRooms,
    fccChatRooms.officialChatRooms,
    fccChatRooms.cityChatRooms,
    fccChatRooms.casualChatRooms,
    otherChatRooms
].reduce(function (rooms, currRooms) {
    return rooms.concat(currRooms);
}).map(function (room) {
    return {
        name: room
    };
});
i didnt add that method tho?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:48
@dcsan yes. I did. You can git blame me!
dc
@dcsan
Aug 25 2015 20:48
you just wanted to use reduce rather than array.concat ?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:48
oops!
dc
@dcsan
Aug 25 2015 20:48
seems a bit too clever to me
someone else (me) has to read this code btw...
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:49
@dcsan how do i use array.concat with unknown number of arrays to concat?
@dcsan that's the reason I used reduce
dc
@dcsan
Aug 25 2015 20:49
oh it only adds values ok
JS doesn't have overloading for arr1 + arr2 ... >.<
i miss ruby
ok i guess then ...
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:51
and the map is required for making the object
dc
@dcsan
Aug 25 2015 20:51
so what does the map do?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:51
{
    name: 'FreeCodeCamp/Help';
}
dc
@dcsan
Aug 25 2015 20:51
why not just convert the data?
we just need a list of names?
var fccCityChatRoomNames = [
    "Aarhus",
    "AbuDhabi",
    "Accra",
    "Adelaide",
    "Ahmedabad",
which we already have
so change the code below to work on a simple array
and get rid of that whole mess
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:52
@dcsan don't you need an object as
{
    name: 'FreeCodeCamp/Help';
}
dc
@dcsan
Aug 25 2015 20:52
dont think so?
we just need to prepend FreeCodeCamp
dc
@dcsan
Aug 25 2015 20:54
thats assuming every room starts with 'name'
i think we shoudl just rip all that code out and put in hardwired paths to the rooms
"FreeCodeCamp/Aarhus",
etc
and remove all the code that manipulates it
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:55
@dcsan also you said later we can read from a flat array but for now we need an object
dc
@dcsan
Aug 25 2015 20:55
then it will be REALLY obvious whats what
well, yeah you'd have to look at code that joins the rooms
and make sure to just use the string
i started using typescript recently for another project
makes this kind of stuff so easy
Interfaces and method signatures
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:56
but but... till then you can revert the commit that changes the RoomData.js and merge your PR
dc
@dcsan
Aug 25 2015 20:57
not sure
i already merged my hotfix into master
and it looks like your code was also there
but your code works right?
i guess we'll find out next time i deploy :fire:
so in master right now is your current change to the list of rooms
but the object type is actually the same
so should be no problem
Abhisek Pattnaik
@abhisekp
Aug 25 2015 20:59
@dcsan yep! :+1:
dc
@dcsan
Aug 25 2015 20:59
and my fix to stagger loading means we get around gitter API rates
so i can deploy that sometime soon
not right now maybe tmrw
but.. be nice to get some other changes in
can you look at analytics thing maybe?
Abhisek Pattnaik
@abhisekp
Aug 25 2015 21:02
This message was deleted
@dcsan is it a good idea to hardcode the org. names along with room names? Is it a good maintainable JS practice?
@dcsan separating them might be helpful in future. You never know what kinda feature we might add to the bot.

@dcsan about this code

// @TODO Refactor into a room generator function
var camperBotRooms = [
    camperBotChatRooms,
    fccChatRooms.officialChatRooms,
    fccChatRooms.cityChatRooms,
    fccChatRooms.casualChatRooms,
    otherChatRooms
].reduce(function (rooms, currRooms) {
    return rooms.concat(currRooms);
}).map(function (room) {
    return {
        name: room
    };
});

The code can be refactored later to make a room generator function.

Abhisek Pattnaik
@abhisekp
Aug 25 2015 21:11
@dcsan I want this bot to be used as a general gitter bot whc can be used directly by anyone for their org. with no change to the core bot modules. So i want the bot to be refactored one-step at a time to make it usable by anyone w/o any maintenance.
@dcsan so I'm not in favour of hardcoding anything. APIs change over time. So you never know when this kinda data structure might come in handy in future.
Abhisek Pattnaik
@abhisekp
Aug 25 2015 21:23

@dcsan pls correct this code and commit again to the master. You didn't test the code.
:warning: :warning: :warning: Alert!! Errrrror...

<<<<<<< HEAD
        if (mentions && mentions.length == 0 ) {
            Utils.warn("thanks without any mentions", input.message.model);
            return "if you want to thank someone, put an @ before their name!";
        }
=======
        if (mentions && mentions.length === 0 ) {
            Utils.warn("thanks", "without any mentions", input.message.model);
            return null;
        } // just 'thanks' in a message
>>>>>>> 13b9d361749ea5a3109d5ee3135e62f4d85abf87

See https://github.com/dcsan/gitterbot/blob/00fccb666d4b8cabdc5dd5ef972265d8b624736b/nap/lib/bot/cmds/thanks.js#L46-L56

CamperBot
@camperbot
Aug 25 2015 21:23
abhisekp sends brownie points to @dcsan :sparkles: :thumbsup: :sparkles:
:star: 96 | @dcsan | http://www.freecodecamp.com/dcsan
Abhisek Pattnaik
@abhisekp
Aug 25 2015 22:20

@dcsan

Good News

Tested the new code by joining 400+ Rooms using a demo bot.
It works!!! Hurray!
I've also recorded it.