Skip to content

Commit df52166

Browse files
authored
remove version check (#42)
Removes the clunky version check
1 parent 9f1501c commit df52166

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

linkedin2username.py

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import time
1515
import argparse
1616
import getpass
17-
from distutils.version import StrictVersion
1817
import urllib.parse
1918
import requests
2019

@@ -150,51 +149,6 @@ def parse_arguments():
150149
return args
151150

152151

153-
def check_li2u_version():
154-
"""Checks GitHub for a new version
155-
156-
Uses a simple regex to look at the 'releases' page on GitHub. Extracts the
157-
First tag found and assumes it is the latest. Compares with the global
158-
variable CURRENT_TAG and informs if a new version is available.
159-
"""
160-
latest_rel_regex = r'/initstring/linkedin2username/tree/(.*?)"'
161-
session = requests.session()
162-
rel_url = 'https://github.com/initstring/linkedin2username/releases'
163-
rel_chars = re.compile(r'[^0-9\.]')
164-
165-
# Scrape the page and grab the regex.
166-
response = session.get(rel_url)
167-
latest_rel = re.findall(latest_rel_regex, response.text)
168-
169-
# Remove characters from tag name that will mess up version comparison.
170-
# Also just continue if we can't find the tags - we don't want that small
171-
# function to break the entire app.
172-
if latest_rel[0]:
173-
latest_rel = rel_chars.sub('', latest_rel[0])
174-
else:
175-
return
176-
177-
# Check the tag found with the one defined in this script.
178-
if CURRENT_REL == latest_rel:
179-
print("")
180-
print(PC.ok_box + "Using version {}, which is the latest on"
181-
" GitHub.\n".format(CURRENT_REL))
182-
return
183-
if StrictVersion(CURRENT_REL) > StrictVersion(latest_rel):
184-
print("")
185-
print(PC.warn_box + "Using version {}, which is NEWER than {}, the"
186-
" latest official release. Good luck!\n"
187-
.format(CURRENT_REL, latest_rel))
188-
return
189-
if StrictVersion(CURRENT_REL) < StrictVersion(latest_rel):
190-
print("")
191-
print(PC.warn_box + "You are using {}, but {} is available.\n"
192-
" LinkedIn changes often - this version may not work.\n"
193-
" https://github.com/initstring/linkedin2username.\n"
194-
.format(CURRENT_REL, latest_rel))
195-
return
196-
197-
198152
def login(args):
199153
"""Creates a new authenticated session.
200154
@@ -700,9 +654,6 @@ def main():
700654
print(BANNER + "\n\n\n")
701655
args = parse_arguments()
702656

703-
# Check the version
704-
check_li2u_version()
705-
706657
# Instantiate a session by logging in to LinkedIn.
707658
session = login(args)
708659

0 commit comments

Comments
 (0)