Spaces:
Sleeping
Sleeping
#!/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) | |