From d67727efcf0b78ac3d7eae26a1d68f73d6705c76 Mon Sep 17 00:00:00 2001 From: yyhh91 Date: Fri, 4 Jun 2021 18:34:00 +0800 Subject: [PATCH 1/2] Updated linkedin profile link not displayed correctly if there is emoji in the URL --- .gitignore | 2 ++ LinkedInt.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3eb91bd..9d69f09 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ LinkedInt.cfg +*.html +*.csv \ No newline at end of file diff --git a/LinkedInt.py b/LinkedInt.py index e841e33..da2adca 100644 --- a/LinkedInt.py +++ b/LinkedInt.py @@ -223,7 +223,7 @@ def get_search(): data_picture = "" - + data_slug = repr(data_slug.encode("utf-8")).replace("\\x","%").replace("b","",1).replace("'","") parts = data_lastname.split() name = data_firstname + " " + data_lastname @@ -311,7 +311,7 @@ def get_search(): f.close() f = open(baseDir + '{}.csv'.format(outfile), 'wb') newcsv='\n'.join(csv) - f.writelines(newcsv.encode()) + f.write(newcsv.encode()) for x in csv: f.write(x.join('\n').encode()) f.close() From c1057a58adadb893500f2183caa90cf448fdfac0 Mon Sep 17 00:00:00 2001 From: yyhh91 Date: Fri, 4 Jun 2021 18:40:08 +0800 Subject: [PATCH 2/2] Fix Url encoding when there is emoji in linkedin profile link --- LinkedInt.cfg | 5 ++--- LinkedInt.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/LinkedInt.cfg b/LinkedInt.cfg index 28cdf94..755df71 100644 --- a/LinkedInt.cfg +++ b/LinkedInt.cfg @@ -1,7 +1,6 @@ [API_KEYS] -hunter = +hunter = "" [CREDS] linkedin_username = -linkedin_password = - +linkedin_password = \ No newline at end of file diff --git a/LinkedInt.py b/LinkedInt.py index da2adca..212fb75 100644 --- a/LinkedInt.py +++ b/LinkedInt.py @@ -332,7 +332,7 @@ def authenticate(): if __name__ == '__main__': print("") - a = open(baseDir + "banner.txt","r") + a = open(baseDir + "banner.txt","r", encoding="utf-8") print(a.read()) a.close() print("")