# -*- coding: utf-8 -*-
import io, json, re
bl = json.load(io.open('_heartbeat_baseline.json', encoding='utf-8'))
print('round', bl['round'], 'bytes', bl['main_file_bytes'], 'density', bl['density_grade'], 'notes', bl['notes'])
t = io.open('index_main.html', encoding='utf-8').read()
for pid in ['ucla-economics-phd', 'ucla-statistics-phd', 'ucla-biostatistics-phd', 'ucla-molbio-phd',
            'ucla-bmsb-phd', 'ucla-bio-phd', 'ucla-human-genetics-phd', 'ucla-bioinformatics-phd']:
    i = t.find('{id:"' + pid + '"')
    b = t[i:i + 700]
    m = re.search(r'ddl:"([^"]*)"', b)
    c = re.search(r'test:{cls:"([^"]*)"}', b)
    print(pid, (m.group(1)[:30] if m else 'NONE'), (c.group(1) if c else 'NONE'))
