~fkfd/one_top_song

one_top_song/data/mkhtml_freq.py -rw-r--r-- 402 bytes
26ca7fbcFrederick Yin Remove "ripped" (Redecorate) 11 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import json

f = open("words.json")
words = json.load(f)
f.close()

freqf = open("most_frequent")
freq_words = freqf.read().splitlines()
freqf.close()

html = ""

for idx, fw in enumerate(freq_words):
    for word in words:
        if word["word"] == fw:
            html += f"<tr><td>{fw}</td><td>{word['track']}</td></tr>\n"


htmlf = open("frequent_words.html", "w")
htmlf.write(html)
htmlf.close()