Forums » Linux

Check who is online (new version)

May 09, 2004 birre link
Due to some changes, here is a new version of "vprint"

#!/bin/bash
#
# Print a list of Vendetta players online /Birre
(
date
lynx -width=120 -dump\
'http://www.vendetta-online.com/h/active.html' |\
egrep -i '(itani|serco|n\.t|online)' |\
sed -e 's,^ \+\(.*\),\1,'
) | tee -a ~/.vendetta/vlog



/norsborg
May 09, 2004 Kefeus link
You forgot a "blank" after -dump
;)
May 09, 2004 birre link
In the real file, the lynx command is only one line, but there was some problems to post the script in the web form, so ....
sorry.

lynx -width=120 -dump 'http://www.vendetta-online.com/h/active.html' |\

/Birre (norsborg)
Sep 15, 2004 birre link
Method #1 that only works when IRC is on and working.
alias players "msg irc active players"
bind "p" players

I hope IRC get a free ticket when we pay for playing
Or maybe there should be a command in vendetta to list
current players, and a interface to IRC for offline players.

Method #2 vprint, that I use when IRC don't respond.

#!/bin/bash
#
# Print a list of Vendetta players online /Birre
PROG=lynx
rpm -q $PROG >/dev/null && (\

date
$PROG -width=120 -dump 'http://www.vendetta-online.com/h/active.html' |\
egrep -i '(itani|serco|neutral|online)' |\
sed -e 's,^ \+\(.*\),\1,'
) | tee -a ~/.vendetta/vlog \
|| echo Please install $PROG first.

/birre
Mar 26, 2006 firsm link
Hello,

Well here's another script, but this one gets the names from the website, so the client doesn't need to run and since I don't care about nations, this script feels the same way.
--------------
#!/bin/sh

// This is just 1 line
PLAYERS=`curl -s http://www.vendetta-online.com/h/active.html | grep rankText | awk 'NR%2' | sed -e 's|^.*<td class=rankText align=left>||' -e 's|</td>.*$||' -e 's/ */%/g'`

echo -n "Players currently online: "
LIST=`for players in $PLAYERS; do echo -n "$players, "; done`

echo -n $LIST | sed -e 's/%/ /g' -e 's#,$##'
echo
-------------

Should work with lynx -source, too

Is there any way to execute this script from the vendetta client?

firsm