Hi all,

So I've been motivated to start coding on some neo related stuff as a pet project for fun. I know there's a lot of stuff out there for neopets, but there are a few private servers like neopets classic and virtu pets that I figured I would use as testing grounds to see if I could find code and adapt it. I'm still relatively new to programming (only 2 years past my masters degree and working experience), so my knowledge with libraries like "requests" are pretty limited.

I was looking at a basic class that was posted in the open source section below:

Code:
class neo:
    def __init__(self):
        self.s = requests.session()
        self.base = 'http://www.neopets.com/'
        self.s.headers.update({'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
                               'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
                               'Accept-Encoding': 'gzip, deflate', 'Accept-Language': 'en-US,en;q=0.9'})
        self.settings = 'bot_settings.db'

def log(self, msg):
        print(time.strftime('%A') + ' ' + '%s%s'%(time.strftime('%H:%M:%S '),msg.encode('utf-8').decode('utf-8')))

def header(self, path):
        self.s.headers.update({'Referer': self.base + path})

def login(self):
        f = open(os.path.join('accounts', 'accounts.txt'), 'r')
        data = f.readline().rstrip().split(':')
        f.close()
        url = self.base + 'index.phtml'
        self.s.get(url)
        url = self.base + 'login.phtml'
        login = {'destination': '%2Findex.phtml', 'username': data[0], 'password': data[1]}
        self.header('index.phtml')
        r = self.s.post(url, data=login)
        if r.url == self.base + 'index.phtml':
            os.system('cls') #Clears previous console output from CK authorization
            self.log('Logged in as %s' % data[0])
Main Questions:
1) How does the destination key work? In example if I were to change the basic url from neopets.com to neopetsclassic.com - would it still work? How would I learn what the destination code is?
2) When Ive done post requests in the past they'll normally return a code such as 200 for success or 404 for an error, etc. How would you know if a login was actually successful?

If these questions are more general in knowledge (vs neopets specific) and you think there are comprehensive resources to learn this from, I'd be super thankful if you could send me in the right direction.

Thanks guys