def get_qiubai_img(self): url = "http://m.qiushibaike.com/imgrank" s = QiubaiSpider(url) l = s.get_img(url) i = random.choice(l) img_url = i.get("img") print img_url pic = StringIO.StringIO(requests.get(img_url).content) self.weibo_app.post_img(i.get("content"), pic)
def get_qiubai_img(self): url = "http://m.qiushibaike.com/imgrank" s = QiubaiSpider(url) l = s.get_img(url) i = random.choice(l) img_url = i.get('img') print img_url pic = StringIO.StringIO(requests.get(img_url).content) self.weibo_app.post_img(i.get('content'), pic)
def get_qiubai_duanzi(self): url = "http://m.qiushibaike.com/text" s = QiubaiSpider(url) l = s.get_duanzi(url) i = random.choice(l) self.weibo_app.post_text(i.get("content"))
def get_qiubai_duanzi(self): url = "http://m.qiushibaike.com/text" s = QiubaiSpider(url) l = s.get_duanzi(url) i = random.choice(l) self.weibo_app.post_text(i.get('content'))