DanGough / Nevergreen

This module is an alternative to Evergreen, and allows you to find the latest version and download URL for various Windows apps. Evergreen uses API queries to obtain its data whereas this module is more focussed on web scraping. This is more prone to breaking when websites are changed, hence the name.
The Unlicense
71 stars 16 forks source link

[New App Request] Azeus Convene #67

Open AScott-WWF opened 3 weeks ago

AScott-WWF commented 3 weeks ago

Here is my NeverGreen script to return the latest versions of Azeus Convene for Windows and MacOS, this is obtained using a webscrape against https://www.azeusconvene.com/downloads

In order for the script to return MacOS versions too, this does require the modification of the New-NevergreenApp.ps1script via an additional 'dmg' file type in the ValidateSet setting within the Type attribute (currently line 83 and then update comment on line 30) P.S. If this script is to only return the Windows version - Lines 9 and 10 (within the $Platforms splat) could be removed or commented out

N.B. This is quite a niche app request, but thought I'd share my code in case it is useful for anyone else.

# Get-AzeusConvene.ps1

$AppName = "Azeus Convene Desktop"
$ReleaseURL = 'https://www.azeusconvene.com/downloads'
[version]$Version = Get-Version -Uri $ReleaseURL -Pattern '<p>Latest Version: v*?(\d+\.\d+(\.\d+){0,2})'

$Platforms = @(
    @{Architecture = 'x64'; Type = 'Exe'; Platform = 'Windows'; Uri = "https://www.azeusconvene.com/installers/winos/standard/convene_setup.$($Version)-64bit.exe"}
    @{Architecture = 'x64'; Type = 'Dmg'; Platform = 'MacOS (Intel)';  Uri = "https://www.azeusconvene.com/installers/macos/standard/Azeus%20Convene.v$($Version).dmg"}
    @{Architecture = 'ARM64'; Type = 'Dmg'; Platform = 'MacOS (Apple)';  Uri = "https://www.azeusconvene.com/installers/macos/standard/Azeus%20Convene.aarch64.v$($Version).dmg"}
)

foreach ($Platform in $Platforms) {

    $SearchCount = 3

    do {
        [version]$AppVersion = ($Platform.Uri | Get-Version -Pattern 'convene.*?(\d+\.\d+(\.\d+){0,2}).+(exe|dmg)')
        New-NevergreenApp -Name $AppName -Version $AppVersion -Uri $Platform.Uri -Platform $Platform.Platform -Architecture $Platform.Architecture -Type $Platform.Type
        break

        $SearchCount--
    } until ($SearchCount -eq 0)

    if ($SearchCount -eq 0) {
        Write-Warning "Could not find release for $($AppName) $($Platform.Platform) $($Platform.Architecture)"
    }
}