Teh Mine

From: Ken (SHIELDSIT) 4 Aug 2011 13:42
To: Drew (X3N0PH0N) 2786 of 3934
Shit man, you didn't sleep very long. I'd still be in a coma if it weren't for work!

Too hot?
From: Peter (BOUGHTONP) 4 Aug 2011 13:53
To: graphitone 2787 of 3934
I couldn't even do splits when I did Taekwondo. :(
From: Peter (BOUGHTONP) 4 Aug 2011 13:56
To: Serg (NUKKLEAR) 2788 of 3934
Say that again and I'll come squash you! :P
From: Peter (BOUGHTONP) 4 Aug 2011 14:08
To: koswix 2789 of 3934
That was just the first video that came up. :P

Some of what he does with the pole is very impressive, but stuff like the one-handed upside-down splits could be done anywhere.

(Was actually looking for something a bit more acrobatic, but none of the subsequent videos I found were as good.)
From: Peter (BOUGHTONP) 4 Aug 2011 14:10
To: Serg (NUKKLEAR) 2790 of 3934
No, this guy is a mentalist:



That guy is just exceedingly flexible, strong, graceful, etc.
From: Drew (X3N0PH0N) 4 Aug 2011 14:24
To: Ken (SHIELDSIT) 2791 of 3934
I woke up. I can't get back to sleep when I wake up so... that's it. Sometimes it happens early :(
From: Ken (SHIELDSIT) 4 Aug 2011 14:34
To: Drew (X3N0PH0N) 2792 of 3934
You should have volunteered to go to work for me. I didn't have any problems staying asleep. :-(
From: ANT_THOMAS 4 Aug 2011 19:28
To: ALL2793 of 3934
Does anyone know of a way to show a log file live on a webpage?

I've searched a bit and not found anything useful.

Chrissssss wants a better chat system where he can see more past chat messages. I want to do this by putting the live chat on the mini-site somehow.

Also, rather than showing the full log file live I want to only show certain sections. Using tail and grep it'd look like this...

code:
tail -fn 500 server.log | grep "[INFO]*<"


Ideas on a postcard.
From: Ken (SHIELDSIT) 4 Aug 2011 19:30
To: ANT_THOMAS 2794 of 3934
Not a clue, but I already have a chat setup on my site if you can't be bothered to set one up. I'd just make a minecraft room.
From: ANT_THOMAS 4 Aug 2011 19:32
To: Ken (SHIELDSIT) 2795 of 3934

But it needs to be able to show the ingame chat.

 

There is some Minecraft IRC chat plugin I could look into and do it that way, but not sure I can be bothered that much.

From: Ken (SHIELDSIT) 4 Aug 2011 19:34
To: ANT_THOMAS 2796 of 3934
I was wondering how that was going to work, otherwise we could just use some other IM. If I have time I'll try to help research for you.
From: ANT_THOMAS 4 Aug 2011 19:38
To: Ken (SHIELDSIT) 2797 of 3934
Nah, it has to be ingame. Otherwise for people who aren't too bothered about chat history (me) we'd have to use two things for mining and chatting.
From: Drew (X3N0PH0N) 4 Aug 2011 19:38
To: ANT_THOMAS 2798 of 3934
Just pull the file into PHP and do something with it there? Then a javascript thing to keep reloading it?

tail would be simpler but then you'd need something constantly running and tailing it out to another file then pulling it in to PHP anyway.
From: Drew (X3N0PH0N) 4 Aug 2011 19:40
To: ANT_THOMAS 2799 of 3934
Or if you've allowed php to do exec then exec the tail from a PHP which is refreshed by JS. Can PHP then get stdout? I''ve not used exec for yeeears.
From: Ken (SHIELDSIT) 4 Aug 2011 19:41
To: ANT_THOMAS 2800 of 3934
Yup I agree.
From: ANT_THOMAS 4 Aug 2011 19:41
To: Drew (X3N0PH0N) 2801 of 3934
Yeah I want it all in one rather than tailing it to another file because that's too many things going on then. I was just showing with the tail example of what I'm after.
From: ANT_THOMAS 4 Aug 2011 19:42
To: Drew (X3N0PH0N) 2802 of 3934
I'm not exactly good at PHP but I shall get reading!
From: Drew (X3N0PH0N) 4 Aug 2011 19:43
To: ANT_THOMAS 2803 of 3934
Just read the file into PHP, chop the bit you want (last n lines) then spit it out. Pull it in all ajaxy-like from a constantly running JS function and that's it.
From: Drew (X3N0PH0N) 4 Aug 2011 19:46
To: ANT_THOMAS 2804 of 3934
Ahh ok. I think all you'd need there is file() or file_get_contents() and a bit of regex to pull out the actual chat messages. Actually, may as well use file() then recurse through the array (file() puts the lines of a file into an array) for ones which don't start with a chat message character and discard those. Shouldn't even need regex then, just strpos()
From: ANT_THOMAS 4 Aug 2011 19:49
To: Drew (X3N0PH0N) 2805 of 3934
So does that only work for the start of a line?

Because the log looks like this...

code:
2011-08-04 18:22:00 [INFO] <Spooneymania> i mean yes
2011-08-04 18:22:03 [INFO] <Jeesus> :D
2011-08-04 18:22:25 [INFO] <Spooneymania> i started a hangout thingu
2011-08-04 18:26:57 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 
2011-08-04 18:36:27 [INFO] wakeupbomb [/94.193.54.69:57470] logged in with entity id 543938 at ([world] 965.90625, 72.0, 94.53125)
2011-08-04 18:36:31 [INFO] [PLAYER_COMMAND] wakeupbomb: /who  
2011-08-04 18:38:15 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 
2011-08-04 18:42:09 [INFO] [PLAYER_COMMAND] Spooneymania: /weather dry 
2011-08-04 18:44:30 [INFO] chrishigs [/86.154.231.70:51136] logged in with entity id 546382 at ([world] -53.995520489623885, 23.0, 221.17613932596916)
2011-08-04 18:44:30 [INFO] [PLAYER_COMMAND] wakeupbomb: /weather wet 
2011-08-04 18:44:41 [INFO] [PLAYER_COMMAND] chrishigs: /who  
2011-08-04 18:44:54 [INFO] [PLAYER_COMMAND] chrishigs: /home  
2011-08-04 18:44:57 [INFO] [PLAYER_COMMAND] chrishigs: /spawn  
2011-08-04 18:45:19 [INFO] [PLAYER_COMMAND] chrishigs: /home  
2011-08-04 18:45:33 [INFO] <wakeupbomb> test
2011-08-04 18:45:38 [INFO] <Spooneymania> 123
2011-08-04 18:48:29 [INFO] [PLAYER_COMMAND] chrishigs: /time day 
2011-08-04 18:51:20 [INFO] [PLAYER_COMMAND] wakeupbomb: /time day 
2011-08-04 18:57:34 [INFO] [PLAYER_COMMAND] chrishigs: /home  
2011-08-04 18:57:45 [INFO] [PLAYER_COMMAND] chrishigs: /sethome  
2011-08-04 18:57:59 [INFO] [PLAYER_COMMAND] chrishigs: /spawn  
2011-08-04 18:59:09 [INFO] Connection reset
2011-08-04 18:59:09 [INFO] chrishigs lost connection: disconnect.endOfStream
2011-08-04 19:01:38 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 
2011-08-04 19:03:22 [INFO] mjwatmough [/82.38.245.253:54757] logged in with entity id 557366 at ([world] -59.25, 75.0, 249.0)
2011-08-04 19:12:22 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 
2011-08-04 19:13:07 [INFO] Read timed out
2011-08-04 19:13:07 [INFO] Spooneymania lost connection: disconnect.endOfStream
2011-08-04 19:13:27 [INFO] Spooneymania [/80.177.102.181:61709] logged in with entity id 561889 at ([world] 784.40625, 74.0, 585.125)
2011-08-04 19:21:12 [INFO] Connection reset
2011-08-04 19:21:12 [INFO] mjwatmough lost connection: disconnect.quitting
2011-08-04 19:24:25 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 
2011-08-04 19:35:02 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 
2011-08-04 19:45:52 [INFO] [PLAYER_COMMAND] Spooneymania: /time day 


So I'd need it to only pick lines that contain "[INFO] <"