w11wo commited on
Commit
566a5ab
1 Parent(s): dffeab2

modified output filename

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -48,9 +48,10 @@ def scrape(url):
48
  )
49
  contents = extract_wikipedia_text(raw_text, language)
50
  json_output = {"source": url, f"title-{language}": title, "pages": contents}
51
- with open("data.json", "w") as f:
 
52
  json.dump(json_output, f)
53
- return json_output, "data.json"
54
 
55
 
56
  style_sheet = "#json-output { max-height: 400px; overflow-y: auto; }"
48
  )
49
  contents = extract_wikipedia_text(raw_text, language)
50
  json_output = {"source": url, f"title-{language}": title, "pages": contents}
51
+ filename = f"{url.split('/')[-1]}.json"
52
+ with open(filename, "w") as f:
53
  json.dump(json_output, f)
54
+ return json_output, filename
55
 
56
 
57
  style_sheet = "#json-output { max-height: 400px; overflow-y: auto; }"