def ymg_post(): """线上发布""" login_url = r'http://www.youmogan.com/user/login/' login_data = urllib.urlencode([('email', '*****@*****.**'), ('password', 'exceptional')]) poster_engine = PostEngine(login_url=login_url, login_data=login_data) #humor # loader = HumorDataLoader(out_text_dir) post_url = r'http://www.youmogan.com/iq/add/' loader = IqDataLoader(out_text_dir_) poster_engine.load_post_data(loader) count = poster_engine.post(post_url) print '%s posted' % count
def local_post(): """本地gae开发用""" login_url = r'http://*****:*****@126.com'), ('password', 'hello1')]) poster_engine = PostEngine(login_url=login_url, login_data=login_data) #humor # post_url = r'http://localhost:8080/humor/add/' # loader = HumorDataLoader(_out_text_dir_) # post_url = r'http://localhost:8080/riddle/add/' # loader = RiddleDataLoader(out_text_dir) post_url = r'http://localhost:8080/iq/add/' loader = IqDataLoader(out_text_dir_) poster_engine.load_post_data(loader) count = poster_engine.post(post_url) print '%s done' % count