def generateRepostMap(self, url, level=2, max=100): self.weibocrawler = weiboCrawler.weiboCrawler() self.visualizationutil = visualizationUtil.visualizationUtil() repost = self.weibocrawler.getRepost(url, level, max) # print repost urlparts = url.split("/") postname = "post_%s_%s" % (urlparts[3], urlparts[4]) # Write dot file out = "./out/" + postname self.visualizationutil.generateDotFile(repost, out)
def generateRepostMap(self, url, level=2, max=100): self.weibocrawler = weiboCrawler.weiboCrawler() self.visualizationutil = visualizationUtil.visualizationUtil() repost = self.weibocrawler.getRepost(url, level, max) # print repost urlparts = url.split('/') postname = 'post_%s_%s' % (urlparts[3], urlparts[4]) # Write dot file out = './out/' + postname self.visualizationutil.generateDotFile(repost, out)
def wordlist(): """Shows a users wordlist or if no user is logged in it will redirect to login. """ if not g.user: return redirect(url_for('login')) # if 'dict' is not in session, if 'wbtoken' is not in session.... session['dict']='TOEFL' #for temp test purpose, need to delete and work on choosedict. dictFile="Dict/"+session['dict']+"dict.dat" mydict = json.load(open(dictFile)) words=wb.weiboCrawler(access_token = session['wbtoken'],expires_in = session['wbtokenexpire'], dict=session['dict'], wordnum=session['wordnum']) return render_template('wordlist.html', wordlist={x:mydict[x] for x in words})
def getPostIdFromUrl(self, url): self.crawler = weiboCrawler.weiboCrawler() return self.crawler.getIdFromUrl(url)
def getPostIdFromUrl(self, url): self.crawler = weiboCrawler.weiboCrawler() return self.crawler.getIdFromUrl(url)