import json


def read_or_addresses(f):
    """
    Extract or_addresses from output of
    https://onionoo.torproject.org/details.
    """
    data = json.load(f)
    relays = data['relays']
    addresses = []
    for relay in relays:
        if not relay['running']:
            continue
        addresses.append(relay['or_addresses'][0])
    return addresses