{
            "ret":1,
            "start":"58.18.0.0",
            "end":"58.18.15.255",
            "country":"中国",
            "province":"内蒙古",
            "city":"兴安",
            "district":"",
            "isp":"联通",
            "type":"",
            "desc":""
        }

def get_location_from_sina(ip):
    """
        {
            "ret":1,
            "start":"58.18.0.0",
            "end":"58.18.15.255",
            "country":"中国",
            "province":"内蒙古",
            "city":"兴安",
            "district":"",
            "isp":"联通",
            "type":"",
            "desc":""
        }
    """
    global sina
    response = requests.get(sina % ip)
    if not response.status_code == 200:
        return
    l = json.loads(response.content)
    if not l['ret'] == 1:
        return
    return ("%s,%s,%s,%s" % (l['country'], l['province'], l['city'], l['isp'])).encode('utf8')