User:Kong/Skills Without Quest Python Script


 * 1) LICENCE: GPL+CC licence of guildwiki

WIKI = 'http://www.guildwiki.org/wiki/' import re from urllib import urlopen

def ParseAll(profs=['Elementalist','Warrior']): profs.sort questskills = ParseSkillQuests for prof in profs: print '--' ,prof, '--' profskills = ParseSkills(prof) for skill in profskills: if not skill in questskills: print skill def ParseAllWiki(profs=['Warrior','Elementalist','Mesmer','Monk','Ranger','Necromancer']): profs.sort questskills = ParseSkillQuests for prof in profs: print '==' ,prof, '==' profskills = ParseSkills(prof) for skill in profskills: if not skill in questskills: print '%s\n' % skill

def ParseSkillQuests: """   returns text of all links in the skill quests page    this will return lots of useless strings..    but that's NOT important.    """ skills = [] i = 0 f = open(r'C:\prj\python\gwskills\data\Skill_Quests.htm') #f = urlopen(XXX) for line in f.readlines: matchlist = re.findall('(.*?)',line) for match in matchlist: skill = match[1] skills.append(skill) f.close return skills

def ParseSkills(prof = 'Warrior'): """   returns non elite skills for prof    """ skills = [] i = 0 #f = open(r'C:\prj\python\gwskills\data\%s_Skills_Quick_Reference.htm' % prof) f = urlopen('%s%s_Skills_Quick_Reference' % (WIKI,prof)) for line in f.readlines: if line.startswith(' '): i+=1 if i == 1: continue m = re.search('(.*?)',line) skill = m.group(2) skills.append(skill) f.close return skills

ParseAllWiki