INNER CODE UNIT · Python
urlToKeywords
wodsuz/EasyApplyJobsBot · utils.py:90
def urlToKeywords(url: str) -> List[str]:
keywordUrl = url[url.index("keywords=")+9:]
keyword = keywordUrl[0:keywordUrl.index("&") ]
locationUrl = url[url.index("location=")+9:]
location = locationUrl[0:locationUrl.index("&") ]
return [keyword, location]
def writeResults(text: str) -> None:
timeStr = time.strftime("%Y%m%d")
fileName = "Applied Jobs DATA - " +timeStr + ".txt"
try:
with open("data/" +fileName, encoding="utf-8" ) as file:
lines = []
for line in file:
if "----" not in line:
lines.append(line)
with open("data/" +fileName, 'w' ,encoding="utf-8") as f: