« first day (2042 days earlier)      last day (2896 days later) » 

12:35 PM
just yes
 
 
5 hours later…
5:55 PM
test
test
testing
 
6:12 PM
!!flip/AWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 
(づ๑ʖ๑)┛︵ⱯMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
 
>>flip AWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
 
@zyabin101 (╯๑.๑)ง︵MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM∀
 
◟(`ﮧ´ ◟ )ɥʇʇd://ɔɥɐʇ˙sʇɐɔʞǝxɔɥɐuƃǝ˙ɔoɯ/nsǝɹs/Іᘔ6ᘔ55
 
6:16 PM
!!flip/Cᴏɴᴏʀ O'Bʀɪᴇɴ
 
(∿°○°)∿Ɔᴏɴᴏʀ O⅋#Ɛ6؛ᗺʀɪᴇɴ
 
nailed it
@{Group ping}
@{<>}
 
What is that? Group ping?
 
working on it
@{Group ping}
This is a message with a @{group ping}
This is an invalid @{{group ping}}
so is this @{}}
How 'bout @{test}}
@{@{test}}
@{test}
@zyabin101 did that ping you?
maybe not
let it snow
@{test} @{test}
@{testers}
Hello!
@{testers}
alright, let's try that again
@{J people}
 
6:38 PM
@CᴏɴᴏʀO'Bʀɪᴇɴ This message pinged me.
Group pings don't work on mine.
 
@zyabin101 Ah, cool
@zyabin101 Yeah, you don't have the script yet
 
I couldn't have it.
I'm on QtWeb, which doesn't support user scripts.
 
you could copy+paste the javascript
 
Ah!
 
function storageAvailable(type) {
	try {
		var storage = window[type],
			x = '__storage_test__';
		storage.setItem(x, x);
		storage.removeItem(x);
		return true;
	}
	catch(e) {
		return false;
	}
}

var observeDOM = (function(){
    var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
        eventListenerSupported = window.addEventListener;

    return function(obj, callback){
        if( MutationObserver ){
            // define a new observer
            var obs = new MutationObserver(function(mutations, observer){
 
6:40 PM
Just wait, until I open up the web inspector...
 
Rudimentary, doesn't yet ping--just alerts
 
@{Group ping}
Bug D:
 
?
did you add that group?
 
I added the group @{Group ping}, mentioned it in my own message, and it pinged myself.
It shouldn't ping myself when mentioning a group I am in in my own message.
 
it should, it's a group ping
 
6:55 PM
But, pinging myself with a single user ping @zyabin101 doesn't show a mention counter.
 
Alright, final version
gist: Group pings, 2016-05-23 19:01:20Z
function storageAvailable(type) {
	try {
		var storage = window[type],
			x = '__storage_test__';
		storage.setItem(x, x);
		storage.removeItem(x);
		return true;
	}
	catch(e) {
		return false;
	}
}

var observeDOM = (function(){
    var MutationObserver = window.MutationObserver || window.WebKitMutationObserver,
        eventListenerSupported = window.addEventListener;

    return function(obj, callback){
        if( MutationObserver ){
            // define a new observer
            var obs = new MutationObserver(function(mutations, observer){
                if( mutations[0].addedNodes.length || mutations[0].removedNodes.length )
                    callback();
            });
            // have the observer observe foo for changes in children
            obs.observe( obj, { childList:true, subtree:true });
        }
        else if( eventListenerSupported ){
            obj.addEventListener('DOMNodeInserted', callback, false);
            obj.addEventListener('DOMNodeRemoved', callback, false);
        }
    }
})();

// add the button for adding a group
var btn = document.createElement("button");
btn.innerHTML = "add/remove a group";
btn.id = "group-add";
btn.className = "button";
btn.addEventListener("click", function(){
	if(!storageAvailable("localStorage")){
		alert("ERROR: no storage available/storage unsupported");
		return;
	}
	var groupName = prompt("enter the name of the group");
	// validate name--cannot have { or } in it.
	localStorage.chatGroups = localStorage.chatGroups || "{}";
	var ch = JSON.parse(localStorage.chatGroups);
	ch[groupName] = !ch[groupName];
	alert((ch[groupName] ? "You are now" : "You are no longer") + " listening to group notifications for @{"+ groupName + "}");
	localStorage.chatGroups = JSON.stringify(ch);
});
document.getElementById("chat-buttons").appendChild(btn);

var lastMessage = "";

observeDOM(document.getElementById("chat"), function(){
	// get groups
	if(!storageAvailable("localStorage")){
		alert("ERROR: no storage available/storage unsupported");
		return;
	}
	// get most recent message
	var msg = document.querySelector(".user-container:last-child [id^='message-']:last-child .content");
	// get innards
	var txt = msg.innerText || msg.innerHTML;
	if(lastMessage === txt) return;	// don't ping the same message twice
	lastMessage = txt;
	var groupPings = txt.match(/@\{[^{}]+?\}/g);
	if(!groupPings) return;
	
	var ch = JSON.parse(localStorage.chatGroups);
	
	// iterate through pings
	for(var i = 0; i < groupPings.length; i++){
		var ping = groupPings[i].slice(2, -1);
		// console.log(ch[ping], ping, ch);
		if(ch[ping]){
			// break and ping
			new Audio("http://cdn-chat.sstatic.net/chat/se.mp3").play();
			break;
		}
	}
});
 
Last things needed to implement are a group ping count and our own donk noise.
(Y'know, we can't steal Chat.SE's ping sound...)
 
7:21 PM
How? O_o
 
new Audio("http://cdn-chat.sstatic.net/chat/se.mp3").play();
 
I thought the chat/se.mp3 file is private...
 
 
1 hour later…
8:58 PM
Bot restarted after crash.
Bot restarted after crash.
 
9:29 PM
multiline

test
**boldface** test
doesn't work multiline
[tag:tag]
 
9:49 PM
more
testing
 
 
2 hours later…
11:56 PM
!!img/(2R,3S)-2-chloro-3-phenylbutane
 
No result found.
 

« first day (2042 days earlier)      last day (2896 days later) »