Skip to content

Commit

Permalink
convert german umlauts
Browse files Browse the repository at this point in the history
  • Loading branch information
l4rm4nd committed Feb 22, 2023
1 parent 5bc465a commit a3e3e66
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions xingdumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

LOGIN_COOKIE = "<INSERT-YOUR-XING-LOGIN-COOKIE-VALUE>"

# converting german umlauts
special_char_map = {ord('ä'):'ae', ord('ü'):'ue', ord('ö'):'oe', ord('ß'):'ss'}

format_examples = '''
[1] john.doe@example.com > '{0}.{1}@example.com'
[2] j.doe@example.com > '{0[0]}.{1}@example.com'
Expand Down Expand Up @@ -134,12 +137,12 @@
# print employee information as Comma Separated Values (CSV)
print(firstname + ";" + lastname + ";" + position + ";" + gender + ";" + location + ";" + str(email) + ";" + str(fax) + ";" + str(mobile) + ";" + str(phone) + ";" + "https://www.xing.com/profile/" + pagename)
else:
print(firstname + ";" + lastname + ";" + mailformat.format(firstname.lower().replace(".",""),lastname.lower().replace(".","")) + ";" + position + ";" + gender + ";" + location + ";" + str(email) + ";" + str(fax) + ";" + str(mobile) + ";" + str(phone) + ";" + "https://www.xing.com/profile/" + pagename)
print(firstname + ";" + lastname + ";" + mailformat.format(firstname.lower().replace(".","").translate(special_char_map),lastname.lower().replace(".","").translate(special_char_map)) + ";" + position + ";" + gender + ";" + location + ";" + str(email) + ";" + str(fax) + ";" + str(mobile) + ";" + str(phone) + ";" + "https://www.xing.com/profile/" + pagename)
else:
if not mailformat:
print(firstname + ";" + lastname + ";" + position + ";" + gender + ";" + location + ";" + "https://www.xing.com/profile/" + pagename)
else:
print(firstname + ";" + lastname + ";" + mailformat.format(firstname.lower().replace(".",""),lastname.lower().replace(".","")) + ";" + position + ";" + gender + ";" + location + ";" + "https://www.xing.com/profile/" + pagename)
print(firstname + ";" + lastname + ";" + mailformat.format(firstname.lower().replace(".","").translate(special_char_map),lastname.lower().replace(".","").translate(special_char_map)) + ";" + position + ";" + gender + ";" + location + ";" + "https://www.xing.com/profile/" + pagename)

if not args.quiet:
print()
Expand Down

0 comments on commit a3e3e66

Please sign in to comment.