def _unshorten_adfocus(self, uri):
        orig_uri = uri
        try:
            http_header = {
                "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11",
                "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
                "Accept-Language": "nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4",
                "Cache-Control": "no-cache",
                "Pragma": "no-cache"
            }

            r = requests.get(uri, headers=http_header, timeout=self._timeout)
            html = r.text

            adlink = re.findall("click_url =.*;", html)

            if len(adlink) > 0:
                uri = re.sub('^click_url = "|"\;$', '', adlink[0])
                if re.search(r'http(s|)\://adfoc\.us/serve/skip/\?id\=', uri):
                    http_header = {
                        "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.46 Safari/535.11",
                        "Accept-Encoding": "gzip,deflate,sdch",
                        "Accept-Language": "en-US,en;,q=0.8",
                        "Connection": "keep-alive",
                        "Host": "adfoc.us",
                        "Cache-Control": "no-cache",
                        "Pragma": "no-cache",
                        "Referer": orig_uri,
                    }
                    r = requests.get(uri, headers=http_header, timeout=self._timeout)

                    uri = r.url
                return uri, r.status_code
            else:
                return uri, 'No click_url variable found'
        except Exception as e:
            return uri, str(e)
dataset/ETHPy150Open jkehler/unshortenit/unshortenit/base.py/UnshortenIt._unshorten_adfocus/original