Thread: [Fremantle Maemo5] [Announce] Advanced Geocaching Tool
View Single Post
peterleinchen's Avatar
Posts: 4,118 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#265
Originally Posted by rob_kouw View Post
Suddenly I get this error message when downloading the Overview for the visible area: Please go to geocaching.com and set the website language to english. The website is and was set to English; yesterday it still worked perfectly.
Has Geocaching changed things?
Quite annoying...
Today I had some spare time and wanted to use it, but I ran into the same error. And could not solve it easily with logging in to geocaching.com and fiddling with settings (which were all OK).

@rob_kouw
how did You do that? Without doing anything, solve it?
But You were on the right trip.

I solved it on my own, hacking a bit python and asp (which I am not that familiar with).
Changed downloader.py (as rob_kouw suggested and a bit more)
and also
changed cachedownloader.py ( /home/user/.agtl/updates/ )

(as root or with sudo)
sudo rm /opt/advancedcaching/downloader.pyo
sudo leafpad /opt/advancedcaching/downloader.py
Code:
            logger.info("Checking if still logged in...")
            url = 'http://www.geocaching.com/seek/nearest.aspx'
            page = self.get_reader(url, login = False)
            for line in page:
                if 'You are logged in as' in line or 'Hello,' in line or 'LoggedInPanel' in line:
                    self.logged_in = True
                    logger.info("Seems as we're still logged in")
                    page.close()
                    return
                elif 'You are not logged in.' in line or 'Welcome,' in line or 'LoginPanel' in line:
                    logger.info("Nope, not logged in anymore")
                    page.close()
                    break
Code:
        page = self.get_reader(url, values, login = False)
        
        match=False
        for line in page:
            if 'You are logged in as' in line or 'Hello,' in line or 'LoggedInPanel' in line:
                match=True
                break
            elif 'You are not logged in.' in line or 'combination does not match' in line or 'Welcome,' in line or 'LoginPanel' in line:
                raise Exception("Wrong password or username!")
        else:
            logger.info("Seems as if we could not load the web site at all")
            raise Exception("Something totally went wrong ?!?!")
        if match==False:
            logger.info("Seems as if the language is set to something other than english")
            raise Exception("Please go to geocaching.com and set the website language to english!")
sudo run-standalone.sh /opt/advancedcaching/core.py --hildon

(as user)
rm /home/user/.agtl/updates/cachedownloader.pyo
leafpad /home/user/.agtl/updates/cachedownloader.py
Code:
    def login_callback(username, password):
        url = 'http://www.geocaching.com/login/default.aspx'
        values = {'ctl00$ContentBody$tbUsername': username,
            'ctl00$ContentBody$tbPassword': password,
            'ctl00$ContentBody$cbRememberMe': 'on',
            'ctl00$ContentBody$btnSignIn': 'Login',
            '__EVENTTARGET': '',
            '__EVENTARGUMENT': ''
        }
        return url, values
chmod -w .agtl/updates/cachedownloader.py

start AGTL normally (or in console: /opt/advancedcaching/core.py --hildon )

Be sure to keep that order of editing (timestamp of cachedownloader.py should be youngest), or You will get "updated" again and loose Your changes.

I needed changes in both files and only then could log in again.
So, today no caching , but 'programming' .

Hoping webhamster still does some geocaching and will take care of us in future.
Cheers.


--edit
I have to correct me. Somehow my changes were now overwritten anyway, so I could not log in again. I helped myself with a chmod -w. It works, but keep in mind, that You may not get further parser updates by webhamster.
Corrected procedure above.
Attached Files
File Type: zip agtl.zip (9.9 KB, 138 views)

Last edited by peterleinchen; 2011-10-24 at 21:47.
 

The Following User Says Thank You to peterleinchen For This Useful Post: