Skip to content

Commit

Permalink
basic parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
tunisiano187 committed Aug 3, 2024
1 parent 0b72aa0 commit 3c4d972
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion automatic/deluge/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function global:au_AfterUpdate($Package) {
}

function global:au_GetLatest {
$webpage = Invoke-WebRequest -Uri $releases
$webpage = Invoke-WebRequest -Uri $releases -UseBasicParsing
$Files = $webpage.Links | Where-Object { $_.href -match '.exe$'} | Where-Object { $_.href -notmatch 'lt2'} | Select-Object -First 2
$url32 = "$($release)$($Files.href | Where-Object {$_ -match "win32"})"
$url64 = "$($release)$($Files.href | Where-Object {$_ -match "win64"})"
Expand Down
2 changes: 1 addition & 1 deletion automatic/duplicatecleaner/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function global:au_AfterUpdate($Package) {
}

function global:au_GetLatest {
$page = Invoke-WebRequest -Uri $releases
$page = Invoke-WebRequest -Uri $releases -UseBasicParsing
$url32 = "https://www.digitalvolcano.co.uk$(($page.Links | Where-Object {$_.href -match ".msi$"}).href)"
$regexPattern = 'Version\s*(\d+(\.\d+)*)'
$versionMatch = $page.Content | Select-String -Pattern $regexPattern -AllMatches
Expand Down
12 changes: 4 additions & 8 deletions automatic/eagle/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ function global:au_AfterUpdate($Package) {
}

function global:au_GetLatest {
$of = "$env:temp/eagle.exe"
Invoke-WebRequest -Uri $release -OutFile $of -UseBasicParsing

[Version]$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($of).ProductVersion.trim()
$checksumtype = $env:hash_algo
$checksum = Get-FileHash -Path $of -Algorithm $env:hash_algo

$Latest = @{ URL64 = $release; Version = $version; Checksum64 = $checksum; ChecksumType64 = $checksumtype }
. ..\..\scripts\Get-FileVersion.ps1
$FileVersion = Get-FileVersion $release

$Latest = @{ URL64 = $release; Version = $FileVersion.Version; Checksum64 = $FileVersion.Checksum; ChecksumType64 = $FileVersion.ChecksumType }
return $Latest
}

Expand Down
2 changes: 1 addition & 1 deletion automatic/futuremark-systeminfo/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function global:au_AfterUpdate($Package) {
}

function global:au_GetLatest {
$pageContent = Invoke-WebRequest -Uri $releases
$pageContent = Invoke-WebRequest -Uri $releases -UseBasicParsing
$regexPattern = 'SystemInfo \s*(\d+(\.\d+)*)</h2>'
$versionMatch = $pageContent.Content | Select-String -Pattern $regexPattern -AllMatches

Expand Down
2 changes: 1 addition & 1 deletion scripts/Get-FileVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Get-FileVersion {
if($tempFile -match '\?') {
$tempFile = $tempFile.Split('?')[0]
}
Invoke-WebRequest -Uri $url -OutFile $tempFile
Invoke-WebRequest -Uri $url -OutFile $tempFile -UseBasicParsing
try {
[version]$version=$([System.Diagnostics.FileVersionInfo]::GetVersionInfo($tempFile).ProductVersion).trim()
}
Expand Down

0 comments on commit 3c4d972

Please sign in to comment.