def screenshot(args): """Take a screenshot and upload it to Dropbox.""" from screenshot import Screenshot screenshot = Screenshot(args.mode) screenshot.capture() c.handle_files([screenshot.path], [screenshot.filename], args.share)
# titl = respons['title'] # # print titl # suburl_title = get_string(titl) # # print '1: ', req_url # # print '\n' # # print '2: ',value # # print '\n' # suburl_content = respons['content'].encode("ascii", errors="ignore") # # print '3: ',suburl_content # # print '\n4: ' # # print value['response']['content'].encode('ascii',errors="ignore") # # print '\n' s.capture(sub.url, 'temp.png') link = uploadImage('temp.png') # print link st = head_text + link +'\n' # print st # st += suburl_title # st += '\n' # # print st # st += suburl_content # # print st st += foot_text # print 'got st' sub.add_comment(st) already_done.append(sub.id) time.sleep(1800) pickle.dump(already_done, 'already_done.pkl')
import sys from PyQt5.QtWidgets import QApplication from screenshot import Screenshot if __name__ == '__main__': app = QApplication(sys.argv) s = Screenshot() s.app = app s.capture('http://chungtoimuontudo2.wordpress.com', 'chungtoimuontudo2.png') sys.exit(app.exec_())
with open('CONFLICTS_WP_SS') as f: CONFLICTS = ast.literal_eval(f.read()) CONFLICTS = [ ['a3-lazy-load', 'counterize'] # ['comments-from-facebook', 'vk-all-in-one-expansion-unit'], # ['comments-from-facebook', 'disable-google-fonts'], # ['wp-author-date-and-meta-remover', 'comments-from-facebook'], # ['wp-author-date-and-meta-remover', 'vk-all-in-one-expansion-unit'], ] for conflict in CONFLICTS: wp.deactivate(conflict) # capture screenshot from test page without plugins activated default_page = '{}/default_page.png'.format(screenshot._dir) print('capturing default page') screenshot.capture(default_page) print('capturing default end') with open('visual_conflicts.csv', 'a+') as visual: visual_csv = csv.DictWriter(visual, fieldnames=['conflict', 'visual_effects']) visual_csv.writeheader() for conflict in CONFLICTS: print('running {}'.format(conflict)) p1, p2 = conflict[0], conflict[1] _conflict = list_to_string(conflict) # creating a folder for each conflict conflict_dir = ''.join([screenshot._dir, '/', _conflict]) screenshot.create_dir(conflict_dir)