import sys, re
import infogamibot
from html2text import html2text
ET = infogamibot.ET
try:
username = sys.argv[1]
except IndexError:
username = raw_input("Enter username for pyref: ")
bot = infogamibot.Bot(username + "@pyref", cache=1)
def trim(page):
return page.strip("/")
ignore = [
# site stuff
"_pagetemplate", "_template",
"blog", "comments", "contents", "suggest",
# deleted stuff (should automate this)
"method-metaclass", "method-slots", "raise.html",
"parenthesized_forms",
]
index = set(trim(page) for page, title in bot.get_index())
contents = set(trim(page) for page, title in bot.get_index("contents"))
diff = sorted(index - contents - set(ignore))
for page in diff:
if "_comments" in page.split("/"):
continue
print "[%s](%s)" % (page, page)