Why don't you have a shoutbox?

Cthulhu

Administrator
AKA
Yop
My opinion is irrelevant, 'tis but one of many, :awesome:.

The problem with Xenforo IMHO is that it's built by the same dudes that built VB 3 and before; it's decent, but kinda stuck in the past. And they have a tendency to over-engineer the back-end, i.e. using convoluted forms and UI's to do the templates, styles and plugins instead of just saying "Here's the API, chuck .html templates there, CSS there, and done, style". IDK if they still do that with Xenforo, but TBF I've got my doubts.

As for the modern ones, I'm just afraid they're all about fancy modern shit and less about actual features, customizability and speed. But I could be wrong.

Bear with me, :awesome:. I'll get to it next week. maybe.
 

Channy

Bad Habit
AKA
Ruby Rose, Lucy
I don't know anything about this Xenforo :quote:

..but I do know I still don't have a shoutbox. :monster:
 

Cthulhu

Administrator
AKA
Yop
http://thelifestream.net/shoutbox/client.html :awesome: (shut down again for now)

DISCLAIMER: VERY EARLY, very shit, hacked up in an hour or two or however long it's been. Date formatting is shit, etc. I'm gonna go do something else now, if you'd like to improve it, fork and PR and shit:

server code: https://github.com/fwielstra/gobox/blob/master/server.go
client code: https://github.com/fwielstra/gobox/blob/master/static/client.html

Also I'll probably take it offline again later; I'd like to be able to see what happens with it and how the performance is and shit. Actually I'm not worried about the performance of the server itself, more about the Apache proxy in front of it. I should move everything over to a faster / better / more modern webserver (nginx) anyway.
 

Ⓐaron

Factiō Rēpūblicāna dēlenda est.
AKA
The Man, V
Nice start. Hopefully the next step is adding integration with our vB username/password? :monster:
 

Cthulhu

Administrator
AKA
Yop
Yeah, in theory I could just copy / paste the client.html into a template and it should work. If the IDs in the HTML are unique, at least :monster:.

I've set the /shoutbox URL to proxy to the program running internally on port 8080 via Apache, which actually worked on the first try - I'm amazed by myself :monster:. Hope I didn't break anything though.
 

Ⓐaron

Factiō Rēpūblicāna dēlenda est.
AKA
The Man, V
Sounds valid, seems like a good next step :monster: We also need a cookie monster emoticon. :monster: I don’t really care about the other emoticons, some of them are probably too big anyway :monster:
 

Cthulhu

Administrator
AKA
Yop
alright, according to the cpu load it's gonna need some optimization, but then, it did convert all posts to json every five second for anyone with the client page open at the time, :monster:. Needs some optimization there.
 

Cthulhu

Administrator
AKA
Yop
Fiddled with it for a couple hours moar: http://thelifestream.net/shoutbox/client.html

Changes: https://github.com/fwielstra/gobox/commits/master

* Optimized the server; now keeps the json-marshalled poasts in a byte array that is only refreshed whenever someone makes a new poast
* Limited message and username length; right now it's at an arbitrary 1000, which should be fine.
* Fixed the apostrophe and such. Simple HTML is now possible too, but srsly, don't plaster big img tags in there or I will be cross. Abuse (like script tags and xss stuff) shouldn't be possible.
* Simple table layout
* Fixed timestamp formatting
 

Cthulhu

Administrator
AKA
Yop
Moar stuff:

* Added :monster: - check out the code at https://github.com/fwielstra/gobox/blob/master/static/client.html#L62 and send me pull requests if you'd like to see moar. It'd probably be best to eventually replace all replacement smilies in one iteration, but for now, just going

Code:
function parseSmileys(poast) {
  var result = poast
  var result = result.replace(":monster:", "<img src=\"http://thelifestream.net/forums/images/smilies/cookiemonster.gif\">");
  result = result.replace(":something:", "some other smiley");
}

will be fine.

* Added link auto-parsing to clickable links using javascript-linkify. That one hasn't been updated for 6 years though, so with the recent trend of being able to register any top level domain you want for monies, it probably won't work properly anymore. I'll replace it with something more generic if that proves to be an issue.

* Implemented etag headers; basically, the server has a timestamp that indicates when someone last poasted something. That timestamp is sent to a client when it polls for new poasts. The client stores that timestamp, and sends it back to the server when it polls again. If the client timestamp is equal to the server timestamp, the server returns a 304 Not Modified header back. If the client gets a 304 header back, it won't re-render anything. Actually I had to hack around this; it turns out that if you do an xmlhttprequest to a server that returns 304 Not Modified, the callback method gets a regular 200 OK message - which would still trigger a re-render of posts, even if said posts hadn't changed. I haxed this by sending the etag back in the GET response from the server, which is compared on the client (see https://github.com/fwielstra/gobox/blob/master/static/client.html#L70). If it's the same from the previous etag stored on the client, then nothing changed and nothing needs to be done.

TL;DR: moar efficiency, less suboptimality.
 

Flintlock

Pro Adventurer
I don't think we need any smilies beyond : monster :, and maybe a couple of variations (closed monster, awesome monsters, etc.), and in fact, I'd say the same goes for the forum. :monster:
 

Cthulhu

Administrator
AKA
Yop
:monster: ok, removed all smileys but the monster variant on the forums.

Also I like how my last update (the etags stuff) lowered the CPU usage even moar:

cpu-day.png


The first optimized (i.e. not-marshall-all-poasts-as-json-per-request) was put online at around 12 (the little increase at the bottom of the chart), then it drops a bit lower again a while later (at the end) when I implemented the etag thing where the server just goes 'yeah nothing here' instead of re-sending the same shit the client already has.
 

Cthulhu

Administrator
AKA
Yop
Can I just get as much people as possible at once on the shoutbox? No need to poast, just have the tab open somewhere or something. I'd like to see if it has any significant impact on performance - and if not, then at least I know it's better than vBulletin, which would boost my ego :monster:
 

Cthulhu

Administrator
AKA
Yop
I'll have to devise a system for that. But it should be pretty simple - if I take the forum user cookie, I can just keep a timestamp for the last time someone polled for a new message. If that is less than five minutes ago, I'll assume the user is still on. Or something like that.

Also whoever did
tsnGoin.png
... thanks, how'd you do it / how many tabs did you have open? :awesome:
 

Starling

Pro Adventurer
What timezone is that? I generally don't open tabs for more than 10 threads at once and only when there're a bunch of threads I posted in that have new posts since I was last on. I'm also pretty sure I had little to nothing to do with that.
 

Fangu

Great Old One
What does everyone think about the shoutbox being able to indicate how many people are on?
I had the same thought but then I remembered this will be on the forum front page, which has "Who's Online". I'd mark it "minor" and put it in the Backlog. :wacky:
 

Starling

Pro Adventurer
Well, just because people are on the forums doesn't mean they're on the chat. It's be nice to know you're not talking to empty space.
 

Flintlock

Pro Adventurer
If the shoutbox is ultimately implemented in the same way I've seen it on other forums, it'll be on the index page, so everyone browsing the forum will be able to see it without having to go to a separate page. Like Fangu said, you'd be able to tell who might be around to chat with based on the existing "who's online" feature.
 

Cthulhu

Administrator
AKA
Yop
Ehhh, I'll probably add a separate 'open in new window' button, linking to the client as it stands right now. It's gonna be used as a chatbox, I just know it, and I like to keep my chatboxes in a separate window :monster:.

As for that peak, that was about 24 hours ago.
 

Cthulhu

Administrator
AKA
Yop
...SHOUTING, :monster:

I don't know actually, I'm probably just confused with shoutboxes of yore and guestbooks. Which were all basically the same thing, :monster:
 

Channy

Bad Habit
AKA
Ruby Rose, Lucy
Ehhh, I'll probably add a separate 'open in new window' button, linking to the client as it stands right now. It's gonna be used as a chatbox, I just know it, and I like to keep my chatboxes in a separate window :monster:.

As for that peak, that was about 24 hours ago.

24 hrs ago? May have been a combination of people/things. Can you determine any sort of ip or what not? I jumped on my phone on my lunch at that time and browsed for a few. Which, the chatbox is horrible on the phone but that's another issue :monster:


No, I demand the shoutbox be on the index page. And where did that old welcome/stats box go for that matter, how long has that been gone? You people are so blah.
 
Top Bottom