def get_contest(self, url): """Overridden. """ contest = Contest() contest.url = url contest.id = "rosalind-problems" contest.name = "Rosalind problems archive" return contest
def get_contest(self, url): """Overridden. """ contest = Contest() contest.url = url contest.id = "spoj-problems" contest.name = "Spoj problems archive" return contest
def get_contest(self, url): """Overridden. """ url_path = urlparse(url).path assert url_path contest = Contest() contest.url = url tokens = SiteLocal.pattern_contest.search(url_path) contest.id = tokens.group('CONTEST') assert contest.id contest.name = contest.id return contest
def get_contest(self, url): """Overridden. """ url_path = urlparse(url).path assert url_path contest = Contest() contest.url = url tokens = SiteCodeforces.pattern_contest.search(url_path) contest.id = tokens.group('CONTEST') page = SiteCodeforces._proxy.get(url) # Data from web: # - contest name. if page.status_code == 200: t = html.fromstring(page.text) e = t.xpath(SiteCodeforces.xpath_contest_name) contest.name = (e and str(e[0])) or None return contest