wtorek, 15 grudnia 2009

One-liner script to count approximate number of messages in pidgin

You can use this script to counts approximate number of messages from Pidgin history(works only in plain-text archive, not in html). Replace UPPERCASE with appropriate info.
cat .purple/logs/PROTOCOL/MY_PROTOCOL_ID/FRIEND_PROTOCOL_ID/* | grep -w FRIEND_ALIAS | wc -l

where
PROTOCOL is protocol you use for a talk, for example irc jabber or gadu-gadu
MY_PROTOCOL_ID is an ID that you use to log in protocol (if you are only user of pidgin there would be only your folder so you can probably auto-complete it by tapping TAB)
FRIEND_PROTOCOL_ID same as MY_PROTOCOL_ID but for your friend
FRIEND_ALIAS alias that you gave to your friend in pidgin(it is shown before any of his messages), or your alias if you are interested in number of your messages
jabber example:
cat .purple/logs/jabber/me@gmail.com/friendName@gmail.com/* | grep -w friendName | wc -l

Of course script have serious drawbacks, because if you have changed someone alias, or use it often in your messages results would be heavy biased, but otherwise should be good enough approximation.

Krótki skrypt zliczający liczbę wiadomości wysłanych przez użytkownika Pidgina
Skrypt pozwala znaleźć przybliżoną liczbę wiadomości które do kogoś wysłaliśmy, lub od kogoś otrzymaliśmy
cat .purple/logs/PROTOKÓŁ/MOJE_ID/ID_PRZYJACIELA/* | grep -w ALIAS_PRZYJACIELA | wc -l

przykład gadu-gadu:
cat .purple/logs/gadu-gadu/1234/4321/* | grep -w Staszek | wc -l

Brak komentarzy:

Prześlij komentarz