Thread: [Fremantle Maemo5] [Announce] Advanced Geocaching Tool
View Single Post
Posts: 23 | Thanked: 49 times | Joined on May 2011
#405
Hi. Is there anyone willing to help revive this app. I tried on my own but I got as far as creating working crawler with native meamo python modules. Its different thing to make your own code and another to make sens of someone's else code. I've been in touch with Daniel Fett but basically he said he is not interested in AGTL anymore. I tihnk he moved onto Raspberry PI. Ive been in touch with Aapo as well sending him whatever i made but the last time i heard from him must have been two months ago. So back to business. Geocaching website moved to use tokens, I guess mostly to simplify process of logging in through Facebook. As I mentioned earlier I've made a working crawler that can access geocaching website past login. So here it is. I hope someone can make a good use of it.

Code:
import urllib2
import urllib
import cookielib
# import re
from lxml import html

USERNAME = "xxxUSERxxx"
PASSWORD = "yyyPASSWDyyy"

LOGIN_URL = "https://www.geocaching.com/account/login?ReturnUrl=%2Fplay%2Fsearch"
URL = "https://www.geocaching.com/seek"

def main():
    cookie = cookielib.CookieJar()
    opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookie))
    respon = opener.open(LOGIN_URL).read()

    tree = html.fromstring(respon)
    authenticity_token = list(set(tree.xpath("//input[@name='__RequestVerificationToken']/@value")))[0]

    print authenticity_token
    # Create payload
    payload = {
        "Username": USERNAME,
        "Password": PASSWORD,
        "__RequestVerificationToken": authenticity_token
    }

    # Perform login
    result = opener.open(LOGIN_URL, urllib.urlencode(payload))

    result.geturl() 
    info = result.read()
    print info 
if __name__ == '__main__':
    main()

Last edited by DNA_Splice; 2018-03-12 at 07:36.
 

The Following 5 Users Say Thank You to DNA_Splice For This Useful Post: