Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python2
- import os, random, urllib, webbrowser
- baselink = "http://anidb.net/perl-bin/animedb.pl?show=anime&aid="
- #The triple quotes means it searches the HTML of the page (right click, view page source)
- #As of April 12th 2017, it looks like there are 13111 entries on AniDB
- Things_I_dont_like = [
- #""">complete</a>"""
- """>no group</a>"""
- """class="tagname">novel<"""
- """class="tagname">virtual reality""",
- """itemprop="startDate" content="2017"""
- """itemprop="startDate" content="2016"""
- """itemprop="startDate" content="2015"""
- """itemprop="startDate" content="2014"""
- """itemprop="startDate" content="2013"""
- """itemprop="startDate" content="2012"""
- """itemprop="startDate" content="2011"""
- """itemprop="startDate" content="2010"""
- """itemprop="startDate" content="2009"""
- """itemprop="startDate" content="2008"""
- """itemprop="startDate" content="2007"""
- """itemprop="startDate" content="2006"""
- """itemprop="startDate" content="2005"""
- """itemprop="startDate" content="2004"""
- """itemprop="startDate" content="2003"""
- """itemprop="startDate" content="2002"""
- """itemprop="startDate" content="2001"""
- """itemprop="startDate" content="2000"""
- ]
- #Criteria you want to include anyway, if they show up for Things I Don't Like
- #Things_I_like = [
- #]
- valid = False
- while not valid:
- num = random.randint(1,13111)
- link = "%s%d" % (baselink, num)
- urllib.urlretrieve(link, "temp.html")
- page = open("temp.html").read()
- if any(thing in page for thing in Things_I_dont_like):
- print (link, "Nope.")
- #elif not any(thing in page for thing in Things_I_like):
- #print (link, "Nope.")
- else:
- webbrowser.open(link)
- os.remove("temp.html")
- valid = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement