wikitalk_parser / app.py
imvladikon's picture
Create app.py
a3634c7
raw
history blame contribute delete
666 Bytes
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
import streamlit as st
if __name__ == '__main__':
title = st.text_input("title", value="诪讬专讬_专讙讘")
# check if is it link to a page , if so, extract title
if title.startswith("https://"):
title = title.split("/")[-1]
from wikitalk_parser import get_wikitalk_from_api
language = st.text_input("language", value="he")
if st.button("get talk"):
discussions = get_wikitalk_from_api(title, language=language)
output = json.dumps(discussions, ensure_ascii=False, indent=4)
st.json(output)
st.text_area("raw_output", value=output)