Esempio n. 1
0
    def get_opener(self):
        if self.opener is None:
            opener = OnlineJudge.get_opener(self)

            setting = json.load(open('setting.json'))['kcs']
            postdata = dict()
            postdata['user_id'] = setting['user_id']
            postdata['password'] = setting['password']
            postdata['submit'] = '送信'
            params = urllib.urlencode(postdata)
            p = opener.open('http://kcs.miz-miz.biz/login', params)
            print 'Login ... ' + str(p.getcode())
        return self.opener
Esempio n. 2
0
    def get_opener(self):
        if self.opener is None:
            opener = OnlineJudge.get_opener(self)

            setting = json.load(open('setting.json'))['zoj']
            postdata = dict()
            postdata['handle'] = setting['user_id']
            postdata['password'] = setting['password']
            postdata['rememberMe'] = '1'
            postdata['submit'] = 'Login'
            params = urllib.urlencode(postdata)
            p = opener.open(
                'http://acm.zju.edu.cn/onlinejudge/login.do', params)
            print 'Login ... ' + str(p.getcode())
        return self.opener
Esempio n. 3
0
    def get_opener(self):
        if self.opener is None:
            opener = OnlineJudge.get_opener(self)

            setting = json.load(open('setting.json'))['npca']
            postdata = dict()
            postdata['_method'] = 'POST'
            postdata['data[User][username]'] = setting['user_id']
            postdata['data[User][password]'] = setting['password']
            postdata['data[User][active]'] = '1'
            postdata['submit'] = 'Login'
            params = urllib.urlencode(postdata)
            p = opener.open('http://judge.npca.jp/users/login', params)
            print 'Login ... ' + str(p.getcode())
        return self.opener
Esempio n. 4
0
    def get_opener(self):
        if self.opener is None:
            opener = OnlineJudge.get_opener(self)

            setting = json.load(open('setting.json'))['atcoder']
            postdata = dict()
            postdata['name'] = setting['user_id']
            postdata['password'] = setting['password']
            postdata['submit'] = 'login'
            params = urllib.urlencode(postdata)
            url = 'https://%s.contest.atcoder.jp/login' % self.contest_id

            p = opener.open(url, params)
            print 'Login ... ' + str(p.getcode())

        return self.opener