INNER CODE UNIT · Python

get_html

balta2ar/brotab · brotab/main.py:330

def get_html(args):
    brotab_logger.info('Get html from tabs')
    api = MultipleMediatorsAPI(create_clients(args.target_hosts))
    return get_text_or_html(api.get_html, args)


def show_duplicates(args):
    # I'm not using uniq here because it's not easy to get duplicates
    # only by a single column. awk is much easier in this regard.
    # print('bt list | sort -k3 | uniq -f2 -D | cut -f1 | bt close')
    print("Close duplicates by Title:")
    print(
        "bt list | sort -k2 | awk -F$'\\t' '{ if (a[$2]++ > 0) print }' | cut -f1 | bt close")
    print("")
    print("Close duplicates by URL:")
    print(
        "bt list | sort -k3 | awk -F$'\\t' '{ if (a[$3]++ > 0) print }' | cut -f1 | bt close")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…