Skip to content

Instantly share code, notes, and snippets.

@f-prime
Created February 2, 2013 18:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f-prime/4698599 to your computer and use it in GitHub Desktop.
Save f-prime/4698599 to your computer and use it in GitHub Desktop.
The script extracts the link from an ad page.
import urllib
class AdflySkipper:
def __init__(self, url):
self.url = url
def extract(self):
source = urllib.urlopen(self.url).readlines()
for line in source:
if "var zzz" in line:
print line.split()[3].replace("'", '').replace(";", '')
break
if __name__ == "__main__":
url = raw_input("Adfly URL: ")
if "adf" not in url:
print "Invalid URL"
else:
AdflySkipper(url).extract()
@garrettlondon1
Copy link

You took down the Ultor source :(. Damn.

Nice though. Humans can't wait another 5 seconds :).

Do they seriously put the link with text saying var zzz?

Why don't you just have the url param in the extract method rather than having self with a class param..?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment