Skip to content

Commit

Permalink
[typescript-vs2015] Improve screen scraping
Browse files Browse the repository at this point in the history
- Just look for .exe - the 2.6.2 link had a trailing space so wasn't being matched previously.
  • Loading branch information
flcdrg committed Dec 23, 2017
1 parent cd369d6 commit 2662ffe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
[![](http://transparent-favicon.info/favicon.ico)](#)
[chocolatey/flcdrg](https://chocolatey.org/profiles/flcdrg)

This repository contains [chocolatey automatic packages](https://chocolatey.org/docs/automatic-packages).
The repository is setup so that you can manage your packages entirely from the GitHub web interface (using AppVeyor to update and push packages) and/or using the local repository copy.
This repository contains my Chocolatey packages. Where possible I use [chocolatey automatic packages](https://chocolatey.org/docs/automatic-packages). These packages will have an `update.ps1` script in the folder that is run daily to automatically detect and publish new versions.

If there is no `update.ps1`, I haven't got around to creating one yet.

## Prerequisites

Expand Down
6 changes: 3 additions & 3 deletions typescript-vs2015/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ function global:au_GetLatest {
$htmlWeb.AutoDetectEncoding = $true
$doc = $htmlWeb.Load($releases)

$links = $doc.DocumentNode.SelectNodes("//a[substring(@href, string-length(@href) - string-length('.exe') +1) = '.exe']")
$links = $doc.DocumentNode.SelectNodes("//a[contains(@href, '.exe')]")
$link = $links[0]
$url32 = $link.Attributes["href"].Value
$url32 = $link.Attributes["href"].Value.Trim()

$li = $link.ParentNode

# first a should be release notes
$firstA = $li.SelectSingleNode("a")
$releaseNotes = $firstA.Attributes["href"].Value
$releaseNotes = $firstA.Attributes["href"].Value.Trim()

# version in filename isn't always complete, so we search for text description before link

Expand Down

0 comments on commit 2662ffe

Please sign in to comment.