def new_tab(args): prefix, window_id = parse_prefix_and_window_id(args.prefix_window_id) search_query = ' '.join(args.query) brotab_logger.info('Opening search for "%s", prefix "%s", window_id "%s"', search_query, prefix, window_id) url = "https://www.google.com/search?q=%s" % quote_plus(search_query) api = MultipleMediatorsAPI(create_clients(args.target_hosts)) api.open_urls([url], prefix, window_id)
def open_urls(args): """ curl -X POST 'http://*****:*****@urls.txt' curl -X POST 'http://*****:*****@urls.txt' -F 'window_id=749' where urls.txt containe one url per line (not JSON) """ prefix, window_id = parse_prefix_and_window_id(args.prefix_window_id) urls = [line.strip() for line in sys.stdin.readlines()] brotab_logger.info('Opening URLs from stdin, prefix "%s", window_id "%s": %s', prefix, window_id, urls) api = MultipleMediatorsAPI(create_clients(args.target_hosts)) api.open_urls(urls, prefix, window_id)