Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 16 additions & 24 deletions linkedin2username.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,36 +157,31 @@ def split_name(name):
split_name = {'first': parsed[0], 'second': '', 'last': parsed[-1]}

return split_name

def f_last(self):
"""jsmith"""
names = set()
names.add(self.name['first'][0] + self.name['last'])
if self.name['first']:
names.add(self.name['first'][0] + self.name['last'])

if self.name['second']:
names.add(self.name['first'][0] + self.name['second'])

return names

def f_dot_last(self):
"""j.smith"""
names = set()
names.add(self.name['first'][0] + '.' + self.name['last'])

if self.name['second']:
names.add(self.name['first'][0] + '.' + self.name['second'])
def f_dot_last(self):
if self.name['first'] and self.name['last']: # Check if both first and last names are not empty
return {self.name['first'][0] + '.' + self.name['last']}
else:
return set() # Return an empty set if either name part is missing

return names

def last_f(self):
"""smithj"""
names = set()
names.add(self.name['last'] + self.name['first'][0])

if self.name['second']:
names.add(self.name['second'] + self.name['first'][0])

return names
if self.name['last'] and self.name['first']: # Check if both last and first names are not empty
return {self.name['last'] + self.name['first'][0]}
else:
return set() # Return an empty set if either name part is missing

def first_dot_last(self):
"""john.smith"""
Expand All @@ -199,14 +194,11 @@ def first_dot_last(self):
return names

def first_l(self):
"""johns"""
names = set()
names.add(self.name['first'] + self.name['last'][0])

if self.name['second']:
names.add(self.name['first'] + self.name['second'][0])
if self.name['first'] and self.name['last']: # Check if both first and last names are not empty
return {self.name['first'] + self.name['last'][0]}
else:
return set() # Return an empty set if either name part is missing

return names

def first(self):
"""john"""
Expand Down