Thread: EAB File Server
View Single Post
Old 30 October 2017, 10:19   #1565
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 52
Posts: 520
Quote:
Originally Posted by Turran View Post
Thanks. I tried implementing it for fun but the "more then one user found" page messes it up. Not your fault but we need a function to get the exact username from the forums, not just "containing" like it is today.

For example, if I registered a EAB user called "Turbo", I can not check its post count or even existence from your script since we get a lot of users with "Turbo" in their name..
If there is more than one user name in the result (from the actual search at EAB), then the user name given is incomplete/invalid.

The exit codes of my Python script are:

0 = user found, 1 = user not found, 2 = more than one user found.

So, for example, if you want to use this from a Bourne shell script.

Code:
#!/bin/sh
USER="Turran"
OUTPUT=`eab_post_count.py "$USER"`
RTN=$?
if test $RTN -eq 0 ; then
    # user found, do your stuff here
    echo "Post count: $OUTPUT"
fi
Note that the user name match is case-insensitive due to the forum search function.

PS: Updated the Python script post with another bug fix, the forum allows spaces in user names, handling that now.

Last edited by modrobert; 30 October 2017 at 11:54. Reason: Improved the shell example.
modrobert is offline  
 
Page generated in 0.04051 seconds with 11 queries