restructured

This commit is contained in:
lab-cat 2022-05-28 20:05:14 +02:00
parent 0c7163e14d
commit a8bf68780d
8 changed files with 0 additions and 0 deletions

11
scripts/open_list.py Normal file
View file

@ -0,0 +1,11 @@
import sys
import re
import time
import webbrowser
file = sys.argv[1]
with open(file) as f:
for line in f:
u = re.sub(r'#.*', '', line).rstrip()
webbrowser.open(f"https://www.lens.org/lens/search/scholar/list?q=author.affiliation.name.keyword:\"{u}\"", new=2, autoraise=False)
time.sleep(10)

27
scripts/parse.py Normal file
View file

@ -0,0 +1,27 @@
import sys
import re
import webbrowser
if len(sys.argv) >= 2:
uni = sys.argv[1]
else:
file = input("Which university do you want to look at? ")
if len(sys.argv) >= 3:
file = sys.argv[2]
else:
file = input("Which list of universities do you want to parse to an url? ")
url = f"https://www.lens.org/lens/search/scholar/list?q=author.affiliation.name.keyword:\"{uni}\""
url += " AND ("
with open(file) as f:
u = re.sub(r'#.*', '', next(f)).rstrip()
url += f"author.affiliation.name.keyword:\"{u}\""
for line in f:
u = re.sub(r'#.*', '', line).rstrip()
url += f" OR author.affiliation.name.keyword:\"{u}\""
url += ")"
print(url)
webbrowser.open(url)