Created
February 2, 2013 18:04
-
-
Save f-prime/4698599 to your computer and use it in GitHub Desktop.
The script extracts the link from an ad page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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..?