The Lifestream Home The Lifestream Forums The Lifestream Shop Donate to The Lifestream
The Lifestream

ARCHIVED FORUMS

Hello. You are currently viewing the old vBulletin forums, which are now in readonly archive mode.
Please go to https://thelifestream.net/forums to go to the current forums.


Go Back   The Lifestream Forums > Site, Forums, Staff & Projects > Feedback, Suggestions & Questions

Feedback, Suggestions & Questions Need help or have suggestions for TLS? Post here.

Reply
 
Thread Tools
Old 07/08/2015   #31
Cthulhu
Default

http://thelifestream.net/shoutbox/client.html (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/b...ster/server.go
client code: https://github.com/fwielstra/gobox/b...ic/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.
Cthulhu is offline   Reply With Quote
Thanked by 3:
Channy (07/08/2015), Fangu (07/08/2015), The Man (07/08/2015)
Old 07/08/2015   #32
The Man
Default

Nice start. Hopefully the next step is adding integration with our vB username/password?
__________________


You’re better off not dreaming of the things to come
Dreams are always ending far too soon









“When I was twelve, I milked my eel into a pot of turtle stew.
I flogged the one-eyed snake, I skinned my sausage, I made
the bald man cry into the turtle stew, which I do believe my
sister ate. At least, I hope she did.” -Tyrion Lannister
“The management is very bad. In fact, let’s not mince words: The management is terrible!
We’ve had a string of embezzlers, frauds, liars, and lunatics making a string of catastrophic
decisions. This is a plain fact. But who elected them? It was you! You who appointed these
people! You who gave them the power to make your decisions for you! While I’ll admit that
anyone can make a mistake once, to go on making the same lethal errors century after
century seems to me nothing short of deliberate. You have encouraged these malicious
incompetents, who have made your working life a shambles. You have accepted without
question their senseless orders. You have allowed them to fill your workspace with dangerous
and unproven machines. You could have stopped them. All you had to say was, ‘No.’” -V
“If they can get you asking the wrong questions, they don’t have to worry about answers.” -Thomas Pynchon
“All for ourselves, and nothing for other people, seems, in every age of the world, to have been the vile maxim of the masters of mankind.” -Adam Smith
“Why throw money at problems? That's what money is for. Should the nation's wealth be redistributed? It has been and continues to be redistributed to a few people in a manner strikingly unhelpful.” -Kurt Vonnegut
“Socialism never took root in America because the poor see themselves not as an exploited proletariat but as temporarily embarrassed millionaires.” -John Steinbeck
“If you took the most ardent revolutionary, vested him in absolute power, within a year he would be worse than the Tsar himself.” -Mikhail Bakunin
“In all history, there is no instance of a country having benefited from prolonged warfare.” -Sun Tzu
“...pero Capitán, obedecer por obedecer, así, sin pensarlo... sólo lo hacen gentes como usted, Capitán.” -Dr Ferreiro, Pan’s Labyrinth
“If the doors of perception were cleansed, everything would appear to man as it is: infinite. For man has closed himself up, till he sees all things thro' narrow chinks of his cavern.” -William Blake
“Yeah, you really got my act down good, guys. That'll be great. ‘You know, when I’m done ranting about elite power that rules the planet under a totalitarian government that uses the media in order to keep people stupid, my throat gets parched! That’s why I drink Orange Drink.’” -Bill Hicks








last.fm (note: album artwork may sometimes be nsfw) · Fool's Gold · FFOF · FF
the lifestream last.fm group · my old music · my new music · pm for myspace/facebook
The Man is offline   Reply With Quote
Old 07/08/2015   #33
Cthulhu
Default

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 .

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 . Hope I didn't break anything though.
Cthulhu is offline   Reply With Quote
Thanked by:
The Man (07/08/2015)
Old 07/08/2015   #34
The Man
Default

Sounds valid, seems like a good next step We also need a cookie monster emoticon. I don’t really care about the other emoticons, some of them are probably too big anyway
__________________


You’re better off not dreaming of the things to come
Dreams are always ending far too soon









“When I was twelve, I milked my eel into a pot of turtle stew.
I flogged the one-eyed snake, I skinned my sausage, I made
the bald man cry into the turtle stew, which I do believe my
sister ate. At least, I hope she did.” -Tyrion Lannister
“The management is very bad. In fact, let’s not mince words: The management is terrible!
We’ve had a string of embezzlers, frauds, liars, and lunatics making a string of catastrophic
decisions. This is a plain fact. But who elected them? It was you! You who appointed these
people! You who gave them the power to make your decisions for you! While I’ll admit that
anyone can make a mistake once, to go on making the same lethal errors century after
century seems to me nothing short of deliberate. You have encouraged these malicious
incompetents, who have made your working life a shambles. You have accepted without
question their senseless orders. You have allowed them to fill your workspace with dangerous
and unproven machines. You could have stopped them. All you had to say was, ‘No.’” -V
“If they can get you asking the wrong questions, they don’t have to worry about answers.” -Thomas Pynchon
“All for ourselves, and nothing for other people, seems, in every age of the world, to have been the vile maxim of the masters of mankind.” -Adam Smith
“Why throw money at problems? That's what money is for. Should the nation's wealth be redistributed? It has been and continues to be redistributed to a few people in a manner strikingly unhelpful.” -Kurt Vonnegut
“Socialism never took root in America because the poor see themselves not as an exploited proletariat but as temporarily embarrassed millionaires.” -John Steinbeck
“If you took the most ardent revolutionary, vested him in absolute power, within a year he would be worse than the Tsar himself.” -Mikhail Bakunin
“In all history, there is no instance of a country having benefited from prolonged warfare.” -Sun Tzu
“...pero Capitán, obedecer por obedecer, así, sin pensarlo... sólo lo hacen gentes como usted, Capitán.” -Dr Ferreiro, Pan’s Labyrinth
“If the doors of perception were cleansed, everything would appear to man as it is: infinite. For man has closed himself up, till he sees all things thro' narrow chinks of his cavern.” -William Blake
“Yeah, you really got my act down good, guys. That'll be great. ‘You know, when I’m done ranting about elite power that rules the planet under a totalitarian government that uses the media in order to keep people stupid, my throat gets parched! That’s why I drink Orange Drink.’” -Bill Hicks








last.fm (note: album artwork may sometimes be nsfw) · Fool's Gold · FFOF · FF
the lifestream last.fm group · my old music · my new music · pm for myspace/facebook
The Man is offline   Reply With Quote
Old 07/08/2015   #35
Cthulhu
Default

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, . Needs some optimization there.
Cthulhu is offline   Reply With Quote
Old 07/19/2015   #36
Cthulhu
Default

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 is offline   Reply With Quote
Thanked by 7:
Ami (07/19/2015), Channy (07/21/2015), Chloe Frazer (07/19/2015), Fangu (07/19/2015), Flintlock (07/19/2015), The Man (07/19/2015), X-SOLDIER (07/22/2015)
Old 07/19/2015   #37
Cthulhu
Default

Moar stuff:

* Added - check out the code at https://github.com/fwielstra/gobox/b...lient.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/b...lient.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.
Cthulhu is offline   Reply With Quote
Thanked by 3:
Chloe Frazer (07/19/2015), The Man (07/19/2015), X-SOLDIER (07/22/2015)
Old 07/19/2015   #38
Flintlock
Default

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.
Flintlock is offline   Reply With Quote
Old 07/19/2015   #39
Cthulhu
Default

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:



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 is offline   Reply With Quote
Old 07/20/2015   #40
Cthulhu
Default

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
Cthulhu is offline   Reply With Quote
Old 07/20/2015   #41
Starling
Default

What does everyone think about the shoutbox being able to indicate how many people are on?
Starling is offline   Reply With Quote
Old 07/21/2015   #42
Cthulhu
Default

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 this ... thanks, how'd you do it / how many tabs did you have open?
Cthulhu is offline   Reply With Quote
Old 07/21/2015   #43
Starling
Default

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.
Starling is offline   Reply With Quote
Old 07/21/2015   #44
Fangu
Default

Starling wrote: 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.
__________________
Quotes and shit
Pixel wrote: Someone say Pixel Porn?
(SPOILER)
Joe wrote: How does Tidus make Yuna feel better?

Elixer.
Shademp wrote: #Fangustyle
Ghost X wrote: As long as Fangu delivers the pizza, I will not particularly mind what is on it. Even if it is hot fiery death in plant form.


Progress!
2012
Member of the Year, Best Site Contributor (2nd), Best Newcomer, Hottest Female, Bounciest Boobies (3rd), Member You’d Most Like to Meet in Real Life, Most Improved (3rd), Best Drunk/Stoner, “Needs to Spend Less Time on TLS” Award (3rd), Best Ship (1st, Avengu) (3rd, Sprexanghululock), Most Likely to Survive the Zombie Apocalypse (3rd), Most Likely to Save the World, Most Suited to Be on Cosmos’ Side (2nd)

2013
TLS Lifetime Achievement Award (3rd), Best Site Contributor (3rd), Hottest Female, Biggest Non-FF Geek (3rd), Most in Need of Daylight (2nd), Member You'd Most Like to Meet in Real Life, Member You'd Most Like to Bone (2nd), Horniest Member (2nd), Best Drunk/Stoner (3rd), The TLS Literature Prize, Most Talented (Art, Writing, Music, Etc.) (3rd), Best Ass (3rd), Most Fervent TLSer, Most Likely to Go the Extra Mile (3rd)

2014
Member of the Year (2nd), Best Site Contributor (3rd), Hottest Female (2nd), Nicest Smile, Member You'd Most Like to Meet in Real Life, Member You'd Most Like to Bone (2nd), The Lifestream Literature Prize, Best Ass (2nd), Sexiest Voice, Best Ship/TLS OTP (3rd, Sprexanghululock), Most Fervent TLSer (3rd), Most Likely to Make the Best-Tasting Food (2nd), Most Likely to Go the Extra Mile (2nd)

2015
Member you'd most like to bone (2nd), Best Drunk/Stoner (3rd), Hottest female (3rd), Sexiest voice (3rd)

2016
Best Drunk (2nd), Most Likely To Suggest An Award They'll Never Win
Fangu is offline   Reply With Quote
Thanked by:
Flintlock (07/21/2015)
Old 07/21/2015   #45
Starling
Default

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.
Starling is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:50 AM.



Powered by vBulletin®
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.