English Amiga Board


Go Back   English Amiga Board > Other Projects > project.EAB File Server

 
 
Thread Tools
Old 30 October 2017, 19:25   #1581
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 19,265
I already have an user, do I need to do this?
Also:
Quote:
You must login at least once in 7 days after the creation of your user account or it will be disabled.
I don't log in weekly, will my account now be disabled?
Akira is offline  
Old 30 October 2017, 19:34   #1582
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 47
Posts: 11,777
Ok, the 7 days account deletion is a bit too harsh. I only download stuff that's revelant for me. Mostly WHDLoad updates, sometimes there aren't updates for weeks.
Retro-Nerd is online now  
Old 30 October 2017, 20:29   #1583
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 43
Posts: 15,463
Quote:
Originally Posted by Akira View Post
I already have an user, do I need to do this?
Also:
Quote:
You must login at least once in 7 days after the creation of your user account or it will be disabled.
I don't log in weekly, will my account now be disabled?
Quote:
Originally Posted by Retro-Nerd View Post
Ok, the 7 days account deletion is a bit too harsh. I only download stuff that's revelant for me. Mostly WHDLoad updates, sometimes there aren't updates for weeks.
Guys, you are not understanding correctly...

https://grandis.nu:444/eabadduser/ is only for people who don't have an account and want one created

Also, regarding "new" accounts, important bit in bold below:

Quote:
You must login at least once in 7 days after the creation of your user account or it will be disabled.
If you already have an account just login via a web browser as usual i.e.

Code:
ftp://username:password@grandis.nu/
DamienD is online now  
Old 30 October 2017, 21:36   #1584
Dunny
Registered User

Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 1,322
Yay! This is probably the best way to go about this IMO. Mind you, the google drive is pretty useful also when leeching large sets.
Dunny is offline  
Old 30 October 2017, 21:54   #1585
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 52
Posts: 525
New release. Requires Python 2.x (forgot to mention that previously).

Code:
eab_post_count.py v1.15 by modrobert in 2017
Function: Returns the number of posts for a given EAB forum user.
Syntax  : eab_post_count.py -u <username> [-i] [-l YYYY-MM-DD]
Options : -h this help text.
        : -i ignore case sensivity in user name.
          -l last post after YYYY-MM-DD required.
          -u followed by user name.
Result  : 0 = user found, 1 = user not found, 2 = EAB down, 3 = other fail.
Source code.

Code:
#!/usr/bin/env python 

import sys, re, urllib2

titlecmd = "eab_post_count.py"
version = "1.15"
ignorecase = 0
lastpost = 0
userfound = False

if len(sys.argv) == 1: sys.argv[1:] = ["-h"]

def parseurl(url):
    if not url:
        print("Empty URL!")
        sys.exit(3)
    headers = { 'User-Agent' : 'Mozilla/5.0' }
    request = urllib2.Request(url, None, headers)
    try: 
        response = urllib2.urlopen(request)
    except Exception:
        print('URL open failed, EAB down?')
        sys.exit(2)
    content = response.read()
    return content

def pagesearch(content, trigger, start, end):
    sane = 0
    needlestack = []
    while sane == 0:
        curpos = content.find(trigger)
        if curpos >= 0:
            testlen = len(content)
            content = content[curpos:testlen]
            curpos = content.find('"')
            testlen = len(content)
            content = content[curpos+1:testlen]
            curpos = content.find(end)
            needle = content[0:curpos]
            result = content[len(start):curpos]
            if needle.startswith(start):
                needlestack.append(result)
        else:
            sane = 1
    return needlestack

def unescape(s):
    s = s.replace("&lt;", "<")
    s = s.replace("&gt;", ">")
    # this has to be last:
    s = s.replace("&amp;", "&")
    return s

for idx, arg in enumerate(sys.argv):
    if arg == '-h':
        print(titlecmd + ' v' + version +' by modrobert in 2017')
        print('Function: Returns the number of posts for a given EAB forum user.')
        print('Syntax  : ' + titlecmd + ' -u <username> [-i] [-l YYYY-MM-DD]')
        print('Options : -h this help text.')
        print('        : -i ignore case sensivity in user name.')
        print('          -l last post after YYYY-MM-DD required.')
        print('          -u followed by user name.')
        print('Result  : 0 = user found, 1 = user not found, 2 = EAB down, 3 = other fail.')
        sys.exit(3)
    if arg == '-u':
        try:
            username = sys.argv[idx+1]
        except IndexError:
            print('Missing username.')
            sys.exit(3)
        usernameurl = re.sub('[ ]', '%20', username)
    if arg == '-i':
        ignorecase = 1
    if arg == '-l':
        lastpost = 1
        try:
            lpdate = sys.argv[idx+1]
        except IndexError:
            print('Missing date.')
            sys.exit(3)
try:
    username
except NameError:
    print('Username -u option required.')
    sys.exit(3)
        
if lastpost:
    eaburl = "http://eab.abime.net/memberlist.php?do=getall&pp=100&lastpostafter=" + lpdate + "&ausername=" + usernameurl
else:
    eaburl = "http://eab.abime.net/memberlist.php?do=getall&pp=100&ausername=" + usernameurl

eabcontent = parseurl(eaburl)

countlist = pagesearch(eabcontent, 'td class', 'alt2">', '</td>')
userlist = pagesearch(eabcontent, 'member.php?', '>', '</a>')


for idx, item in enumerate(userlist):
    # lets strip those fancy moderators and admins
    userstr = re.sub('<[^<]+?>', '', item)
    if ignorecase:
        if unescape(str.lower(userstr)) == str.lower(username):
            userfound = True;
            break
    else:
        if unescape(str(userstr)) == username:
            userfound = True; 
            break

if userfound == False:
    print("User not found: " + username)
    sys.exit(1)

usercount = idx

for idx, item in enumerate(countlist):
    # hairy stuff below ;)
    if idx < (3 * usercount):
        continue
    stripitem = re.sub('[,]', '', item)
    try:
        print(int(stripitem))
        sys.exit(0)
    except Exception:
        continue
Some examples with explanation:

Code:
eab_post_count.py -u "Turran" -l 2017-06-01
This means Turran's post count will only show if he has posted in the forum sometime after 1st of June, 2017, otherwise the script will return "User not found" and exit with result 1.

Turran, I know this is not exactly what you wanted, but "last post" is less hairy compared to "last visit" because I use EAB search option, hope it helps anyway. Please test and let me know if it works OK.


Code:
eab_post_count.py -i -u "ab positive"
This will ignore case for user 'AB Positive' (yes, some of them have spaces in user name) and return post count. Also note that argument order is not critical any more.


Code:
eab_post_count.py -i -u "agn" -l 2012-01-01
This will give "User not found" and exit with result 1 because user 'AGN' haven't posted for over five years (last post in 2009).


Code:
eab_post_count.py -u \>origami\< -l 2012-01-01
This will return post count for user '>origami<' (last post in 2012). Note that this user name is pretty far from linux friendly.

Code:
#!/bin/sh
USER="Toni Wilen"
OUTPUT=`eab_post_count.py -u "$USER"`
RTN=$?
if test $RTN -ne 0 ; then
    # user name not found or other error
    echo "User not found"
    exit 1
fi
# we have a valid user name
# do your stuff here
echo "Post count: $OUTPUT"
Bourne shell script example.

Changelog:
v1.15 - Worked around vBulletin failing to give exact user name match first when "Number of users per-page" is set to "1".
v1.12 - Added exit/result code 2 when the EAB website is down by properly dealing with the exception.
v1.12 - Added result code 3 for other fail like bad arguments etc.
v1.11 - Fixed font color HTML tag bug, now stripping moderators and admins using regex.
v1.1 - Added -l YYYY-MM-DD option for last post requirement.
v1.0 - Fixed bug with "more than one user", now compares given user name with output from EAB forum (thanks Turran).
v1.0 - Added -i option to ignore case in user name, default (no option) is now case-sensitive user name.
v1.0 - User names with '<', '>' and '&' characters are now handled correctly by converting html escape codes.
Beta - Fixed support for users with > 1000 posts who get a ',' in their counter.
Attached Files
File Type: zip eab_post_count_v1_15.zip (3.1 KB, 17 views)

Last edited by modrobert; 08 November 2017 at 18:19. Reason: Released v1.15.
modrobert is offline  
Old 30 October 2017, 22:01   #1586
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 19,265
Quote:
Originally Posted by DamienD View Post
If you already have an account just login via a web browser as usual i.e.
Still confused.
Is this all just for new users? Re: 7 day activity period.
Do I have to do nothing?
Do I have to login once and forget?
Do I I have to remember to login once a week? (not gonna happen)
Akira is offline  
Old 30 October 2017, 22:13   #1587
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 43
Posts: 15,463
Quote:
Originally Posted by Akira View Post
Still confused.
Is this all just for new users? Re: 7 day activity period.
Do I have to do nothing?
Do I have to login once and forget?
Do I I have to remember to login once a week? (not gonna happen)
I have no idea why you are still confused... You have an FTP account already don't you?

So, ignore the URL https://grandis.nu:444/eabadduser/ as this is only for people who don't have an FTP account and want one created (which happens according to certain criteria that the script handles)

Again, if you already have an account, just login via a web browser as per usual i.e:

Code:
ftp://username:password@grandis.nu/
...or use your favourite FTP client.

The 7 days login; this only applies to new FTP accounts... It would be absolute madness if it also applied to existing FTP accounts

...I've been away on vacation for 2 weeks now and not once logged into the EAB File Server. My FTP account is still active and works perfectly
DamienD is online now  
Old 30 October 2017, 22:20   #1588
Akira
Registered User

Akira's Avatar
 
Join Date: May 2001
Location: New York
Posts: 19,265
Quote:
Originally Posted by DamienD View Post
The 7 days login; this only applies to new FTP accounts... It would be absolute madness if it also applied to existing FTP accounts
That's what was unclear, I needed that confirmation.

So it's: I do nothing :P

Thanks!
Akira is offline  
Old 30 October 2017, 23:42   #1589
Turran
Moderator

Turran's Avatar
 
Join Date: May 2012
Location: Stockholm / Sweden
Age: 45
Posts: 1,111
If you already have an FTP account, you can ignore everything thats been going on in the last 5 pages here, except that you are now limited to 50GB/week =) The "Have to log in once in 7 days", as DamienD says, is a way for me to get rid of all the moro... people who register an FTP account and then never use it (bots). It only applies when you create the new account and only one logon is required. Not every 7 days.

And modrobert, thanks. I'll try it out. I think we need more exit codes though or I'll have a hard time explaining why a user creation was denied.
You either do not exist.
Have not posted enough posts.
Have not been active within <days> days.

If I can't specify why you were denied, we are gonna get spammed here =)
Nice work!
Turran is offline  
Old 30 October 2017, 23:46   #1590
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 47
Posts: 11,777
I forgot my Upload account password, so i've created a new "Retro_Nerd" account a few days ago. Any chance that you know the password for my old "Retro-Nerd" upload account?
Retro-Nerd is online now  
Old 30 October 2017, 23:51   #1591
Turran
Moderator

Turran's Avatar
 
Join Date: May 2012
Location: Stockholm / Sweden
Age: 45
Posts: 1,111
No, but PM what you want the password changed to.
Turran is offline  
Old 31 October 2017, 00:01   #1592
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 47
Posts: 11,777
Works fine now. Thanks!
Retro-Nerd is online now  
Old 31 October 2017, 00:14   #1593
Turran
Moderator

Turran's Avatar
 
Join Date: May 2012
Location: Stockholm / Sweden
Age: 45
Posts: 1,111
Quote:
Originally Posted by modrobert View Post
New release. Requires Python 2.x (forgot to mention that previously).
Testing it here: https://grandis.nu:444/eabaddusertest/
Feel free to play around there. It wont actually add a user to the FTP.

Looks good so far. 15 posts and active in the last 5 days defined. Username is case sensitive =)

Testing more in the morning. Have to go to bed.
Turran is offline  
Old 31 October 2017, 01:28   #1594
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 52
Posts: 525
Quote:
Originally Posted by Turran View Post

And modrobert, thanks. I'll try it out. I think we need more exit codes though or I'll have a hard time explaining why a user creation was denied.
You either do not exist.
Have not posted enough posts.
Have not been active within <days> days.

If I can't specify why you were denied, we are gonna get spammed here =)
Nice work!
I can't do that without several page loads because vBulletin always return "Sorry - no matches. Please try some different terms." regardless if the user is missing or when the 'lastpostafter' variable is in effect. Also, as mentioned previously this is only "last post", not "last visit" (activity).

If you really want to know you can call eab_post_count.py two times for the same user, first time without -l option and the next time with. If first run return 0 and second run return 1 you know it was the "last post" date.

Last edited by modrobert; 31 October 2017 at 01:53.
modrobert is offline  
Old 31 October 2017, 10:39   #1595
Turran
Moderator

Turran's Avatar
 
Join Date: May 2012
Location: Stockholm / Sweden
Age: 45
Posts: 1,111
Quote:
Originally Posted by modrobert View Post
If you really want to know you can call eab_post_count.py two times for the same user, first time without -l option and the next time with. If first run return 0 and second run return 1 you know it was the "last post" date.
Good idea. Done and changed live. =)
Turran is offline  
Old 31 October 2017, 10:59   #1596
Turran
Moderator

Turran's Avatar
 
Join Date: May 2012
Location: Stockholm / Sweden
Age: 45
Posts: 1,111
modrobert: Does not seem like it finds people with other titles or something. Was testing users with spaces in their name (works on your end), but I can't see info from
Toni Wilen
Graham Humphrey
Belgarath

etc
Turran is offline  
Old 31 October 2017, 14:04   #1597
DamienD
Global Moderator

DamienD's Avatar
 
Join Date: Aug 2005
Location: London / Sydney
Age: 43
Posts: 15,463
Maybe the script doesn't like Moderators
DamienD is online now  
Old 31 October 2017, 15:55   #1598
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 52
Posts: 525
Quote:
Originally Posted by DamienD View Post
Maybe the script doesn't like Moderators
Hehe, yes, I think that's it. Jokes aside, pretty close call.

The colour screws it up it seems, for example "<font color="#00744C">Toni Wilen</font>". Just have to strip that font tag when found, I'll figure something out.

EDIT:

OK, I updated the previous release post with eab_post_count.py v1.11.

Changelog v1.11:
* Fixed font color HTML tag bug, now stripping moderators and admins using regex.

Last edited by modrobert; 31 October 2017 at 16:22. Reason: New release.
modrobert is offline  
Old 31 October 2017, 16:32   #1599
Turran
Moderator

Turran's Avatar
 
Join Date: May 2012
Location: Stockholm / Sweden
Age: 45
Posts: 1,111
Thanks, looks good. Although spaces are not allowed on the FTP username, so I guess I must add people who has spaces or other weird chars in their usernames here on EAB manually... grr
Turran is offline  
Old 31 October 2017, 17:03   #1600
modrobert
old bearded fool

modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 52
Posts: 525
Quote:
Originally Posted by Turran View Post
Thanks, looks good. Although spaces are not allowed on the FTP username, so I guess I must add people who has spaces or other weird chars in their usernames here on EAB manually... grr
Maybe you can encode it? For example, if '_' (underscore) character is allowed then use that instead of ' ' (space).

EDIT:

I don't know what programming language you are using, but perhaps you could put something on the web page https://grandis.nu:444/eabadduser/. Check if the user have space or other weird chars, and then suggest a new name in a form they have to confirm with a separate submit, with some relevant info like "Your user name includes characters incompatible with the FTP server, note that some were replaced, as follows: [ Mr_Smith ] [Submit/Confirm]".

If you are using PHP then something like '$username = str_replace(' ', '_', $username);', or use regex.

Last edited by modrobert; 31 October 2017 at 17:38.
modrobert is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
While EAB file server is down... Retroplay project.EAB File Server 23 31 December 2013 01:48
Setting up an EAB file server account. fatman2021 project.EAB 1 26 August 2013 09:24
Is EAB file server deleted ? Ribdevil project.EAB File Server 13 03 February 2012 20:28
EAB File Server structure update TCD project.EAB File Server 38 18 November 2010 07:49
EAB File Server team reinforcement TCD project.EAB File Server 9 22 August 2010 21:39

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 +2. The time now is 19:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.12859 seconds with 14 queries