Skip to content

Commit f38f46c

Browse files
committed
new update
1 parent 9bea7e5 commit f38f46c

8 files changed

Lines changed: 157 additions & 12 deletions

File tree

ChromeDriverWin64/chromedriver.exe

165 KB
Binary file not shown.

Config/Config.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Choose Linkedin login method (1Password/UserData)
2-
LoginMethod=UserData
2+
LoginMethod=UserData
3+
4+
# Write your 1Password item name that holds LinkedIn credentials
5+
ItemName=Personal-LinkedIn

DotSource/1PasswordLogin.ps1

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,48 @@
1-
# Currect DotSource variables
1+
# Check 1 - 1Password Application
2+
#region
3+
4+
# 1Password path
5+
$1PasswordPath = "$env:LocalAppData\1Password"
6+
7+
if (Test-Path -Path $1PasswordPath) {
8+
# Do nothing
9+
}
10+
11+
else {
12+
Write-Output "[!] 1Password is not installed on this system."
13+
Write-Output "[!] LikeParser requires 1Password to function properly."
14+
Write-Output "[!] Script execution has been canceled."
15+
$LoadControlFlag = "fail"
16+
exit
17+
}
18+
#endregion
19+
20+
# Check 2 - 1Password CLI
21+
#region
22+
23+
# Catch and store response
24+
$Respond = winget list 1password-cli
25+
26+
# if statment to check if not installed
27+
if ($Respond -eq "No installed package found matching input criteria.") {
28+
29+
# Install 1password-cli
30+
winget install 1password-cli | Out-Null
31+
Write-Output "[!] 1Password CLI was not detected and has now been successfully installed."
32+
Write-Output "[!] If the script does not function as expected, please restart your computer and try again."
33+
Write-Output ""
34+
35+
36+
}
37+
#endregion
38+
39+
# Currect DotSource variables
240
$LinkedInLoginURL = "https://www.linkedin.com/login"
341

442
# Catch output in a variable
543
op user list *> "$RunPath\temp.txt"
644
$CheckLogin = Get-Content -Path "$RunPath\temp.txt"
745

8-
# 1Password item name
9-
$ItemName = "Personal-LinkedIn"
10-
1146
# User is not logined
1247
if ($CheckLogin -match ".*\[ERROR\].*") {
1348
Invoke-Expression $(op signin)

DotSource/Banner.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
Write-Output " __ _ _ ___ "
1+
Write-Output ""
2+
Write-Output ""
3+
Write-Output ""
4+
Write-Output " __ _ _ ___ "
25
Write-Output " / /(_) | _____ / _ \__ _ _ __ ___ ___ _ __ "
36
Write-Output " / / | | |/ / _ \/ /_)/ _' | '__/ __|/ _ \ '__|"
47
Write-Output "/ /__| | < __/ ___/ (_| | | \__ \ __/ | "
58
Write-Output "\____/_|_|\_\___\/ \__,_|_| |___/\___|_| "
69
Write-Output ""
710
Write-Output " GitHub.com/securityjoes/LikeParser"
811
Write-Output " Author: Eilay Yosfan"
9-
Write-Output " Version: 2.0"
12+
Write-Output " Version: 2.1"
1013
Write-Output ""

DotSource/ForeachURL.ps1

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# Clean the terminal prompt
2-
clear
3-
4-
# Dotsource Banner.ps1 (Print it after the 'clear' prompt)
1+
# Dotsource Banner.ps1 (Print it after the 'clear' prompt)
52
. "$RunPath\DotSource\Banner.ps1"
63

74
# Get text content of URLs.txt and save to a variable

DotSource/LoadControl.ps1

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Check 1 - Google Chrome
2+
#region
3+
4+
# Chrome path
5+
$ChromePath = "$SystemDrive\Program Files\Google\Chrome\Application\chrome.exe"
6+
7+
# if statment to test-path of Chrome
8+
if (Test-Path -Path $ChromePath) {
9+
# Do nothing
10+
}
11+
12+
else {
13+
Write-Output "[!] Chrome is not installed on this system."
14+
Write-Output "[!] LikeParser requires Chrome to function properly."
15+
Write-Output "[!] Script execution has been canceled."
16+
$LoadControlFlag = "fail"
17+
}
18+
19+
20+
#endregion
21+
22+
# Check 2 - Selenium PowerShell Module
23+
#region
24+
# check if selenium is installed on the system
25+
$ModuleCheck = Get-Module -Name Selenium -ListAvailable
26+
27+
# if statment to check the output of the execution
28+
if ($ModuleCheck) {
29+
# Do nothing
30+
}
31+
32+
else {
33+
# Install Selenium module
34+
Install-Module -Name Selenium -Force
35+
Write-Output "[!] The Selenium PowerShell module was not detected and has now been successfully installed."
36+
Write-Output "[!] If the script does not function as expected, please restart your computer and try again."
37+
38+
}
39+
40+
# Import the Selenium module
41+
Import-Module -Name Selenium
42+
#endregion
43+
44+
# Check 3 - ImportExcel PowerShell Module
45+
#region
46+
# check if ImportExcel is installed on the system
47+
$ModuleCheck = Get-Module -Name ImportExcel -ListAvailable
48+
49+
# if statment to check the output of the execution
50+
if ($ModuleCheck) {
51+
# Do nothing
52+
}
53+
54+
else {
55+
# Install ImportExcel module
56+
Install-Module -Name ImportExcel -Force
57+
Write-Output "[!] The ImportExcel PowerShell module was not detected and has now been successfully installed."
58+
Write-Output "[!] If the script does not function as expected, please restart your computer and try again."
59+
60+
}
61+
62+
# Import the ImportExcel module
63+
Import-Module -Name ImportExcel
64+
#endregion
65+
66+
# Check Chrome browser versions
67+
$ChromeVersion = (Get-Item "$SystemDrive\Program Files\Google\Chrome\Application\chrome.exe").VersionInfo.ProductVersion
68+
$ChromeVersion = $ChromeVersion -replace '\..*',''
69+
70+
# Check Chrome driver version
71+
$ChromeDriveVersion = (Get-Item "$RunPath\ChromeDriverWin64\chromedriver.exe").VersionInfo.FileVersion
72+
$ChromeDriveVersion = $ChromeDriveVersion -replace '\..*',''
73+
74+
# if version are the same do:
75+
if ($ChromeVersion -eq $ChromeDriveVersion) {
76+
# do nothing
77+
}
78+
79+
# if versions are not the same do:
80+
else {
81+
Write-Output ""
82+
Write-Output "[!] Chrome browser version is $ChromeVersion but your Chrome driver version is $ChromeDriveVersion"
83+
Write-Output "[!] Please download the matching Chrome driver for your Chrome browser"
84+
Write-Output "[!] And save it under $RunPath\ChromeDriverWin64\"
85+
Write-Output "[!] URL to download: https://getwebdriver.com/"
86+
Write-Output ""
87+
$LoadControlFlag = "fail"
88+
89+
90+
}

DotSource/ReadConfig.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# Variables to load
1+
# Path to config file
22
$ConfigPath = "$RunPath\Config\Config.txt"
33

4+
# Collect the 1Password item name value from the config.txt
5+
$ItemName = (Select-String -Path $ConfigPath -Pattern "ItemName").Line
6+
$ItemName = $ItemName -replace '.*\=',''
7+
48
# Collect the LoginMethod value from the config.txt
59
$LoginMethod = (Select-String -Path $ConfigPath -Pattern "LoginMethod").Line
610
$LoginMethod = $LoginMethod -replace '.*\=',''

Start.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,22 @@ $SystemDrive = $env:SystemDrive
2222
$WebDriverPath = "$RunPath\ChromeDriverWin64\"
2323
$ChromePath = "$SystemDrive\Program Files\Google\Chrome\Application\chrome.exe"
2424

25+
# Dotsource LoadControl.ps1
26+
. "$RunPath\DotSource\LoadControl.ps1"
27+
28+
# First load control variable check
29+
if ($LoadControlFlag -eq "fail") {
30+
exit
31+
}
32+
2533
# Dotsource ReadConfig.ps1
2634
. "$RunPath\DotSource\ReadConfig.ps1"
2735

36+
# Second Load control variable check
37+
if ($LoadControlFlag -eq "fail") {
38+
exit
39+
}
40+
2841
# Dotsource DownloadConvertExcel.ps1
2942
. "$RunPath\DotSource\DownloadConvertExcel.ps1"
3043

0 commit comments

Comments
 (0)