def check_url(url):
    """ Check if the url available """
    ret = 0
    code = 404
    try:
        from urllib2 import urlopen
    except:
        from urllib.request import urlopen
    try:
        resp = urlopen(url)
        code = resp.getcode()
    except:
        pass
    if code != 200:
        ret = 1
    return ret
