def onPriv(self, irc, channel, nick, msg): #start parsing msg = irc.extractMsg(msg) if msg != '!jobs': return url = "http://bestjobs.ph/bt-joblist.htm?Bqd=&Bqd=%2BSC003&Bqd=%2BTM003&BqdPalabras=freelance+php&x=14&y=14" data = {} headers = { "User-Agent": "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)" } resp = urllib.urlopen(url) doc = resp.read() p = JobsDbParser() p.feed(doc) for i in p.latest: s = GoogleShortener() s.shorten_and_do(i['link'], self.pretty_print, i, channel, irc)