def METHOD_NAME(url):
    res = urlparse(url)
    if res.scheme not in ['http', 'https']:
        return ''
    if res.netloc != 'www.mcbbs.net':
        return ''
    match = MCBBS_HTML_PATTERN.match(res.path)
    if match:
        return match.group('modid')
    query = parse_qs(res.query)
    if res.path == '/forum.php':
        if 'mod' in query and 'tid' in query and query['mod'] == ['viewthread']:
            return query['tid']
    return ''