-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 43 automated testing numbers (#87)
write issues into environment variables and use them for file existing test code can be reduced, if the variables can be set up in an extra job. but it was not working , when tested see [documentation](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idoutputs) closes #43 closes #59
- Loading branch information
Showing
5 changed files
with
130 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
# ------------------------------------------------------------------ | ||
# [Author] rubemlrm - https://github.com/joergi/MagPiDownloader | ||
# downloader for all MagPi issues | ||
# they are downloadable for free under https://www.raspberrypi.org/magpi/issues/ | ||
# or you can buy the paper issues under: http://swag.raspberrypi.org/collections/magpi | ||
# this script is under GNU GENERAL PUBLIC LICENSE | ||
# ------------------------------------------------------------------ | ||
|
||
# VERSION=0.1.2 | ||
# USAGE="Usage: sh magpi-issue-downloader.sh [-f firstissue] [-l lastissue]" | ||
|
||
Param( | ||
[string]$f, | ||
[string]$l | ||
) | ||
|
||
# control variables | ||
$i = 1 | ||
$baseDir = (Split-Path -Path $PSScriptRoot -Parent) | ||
$issues = Get-Content "$baseDir\sources-for-download\regular-issues.txt" -First 1 | ||
$baseUrl = "https://magpi.raspberrypi.org/issues/" | ||
$web = New-Object system.net.webclient | ||
$errorCount = 0 | ||
|
||
# Check if directory dont exist and try create | ||
if ( -Not (Test-Path -Path "$baseDir\issues" ) ) { | ||
New-Item -ItemType directory -Path "$baseDir\issues" | ||
} | ||
|
||
|
||
if ($f) { | ||
$i = [int]$f | ||
} | ||
|
||
if ($l) { | ||
$issues = [int]$l | ||
} | ||
|
||
do { | ||
#start scrapping directory and download files | ||
|
||
$tempCounter = if ($i -le 9) { "{0:00}" -f $i } Else { $i } | ||
|
||
$fileReponse = ((Invoke-WebRequest -UseBasicParsing "$baseUrl$tempCounter/pdf").Links | Where-Object { $_.href -like "http*" } | Where-Object class -eq c-link) | ||
if ($fileReponse) { | ||
try { | ||
$web.DownloadFile($fileReponse.href, "$baseDir\issues\" + $fileReponse.download) | ||
Write-Verbose -Message "Downloaded from $fileReponse.href" | ||
} | ||
Catch { | ||
Write-Verbose -Message $_.Exception | format-list -force | ||
Write-Verbose -Message "Ocorred an error trying download $fileReponse.download" | ||
$errorCount++ | ||
} | ||
} | ||
$i++ | ||
} While ($i -le $issues) | ||
|
||
if ($errorCount -gt 0) { | ||
exit 1 | ||
} | ||
## ------------------------------------------------------------------ | ||
## [Author] rubemlrm - https://github.com/joergi/MagPiDownloader | ||
## downloader for all MagPi issues | ||
## they are downloadable for free under https://www.raspberrypi.org/magpi/issues/ | ||
## or you can buy the paper issues under: http://swag.raspberrypi.org/collections/magpi | ||
## this script is under GNU GENERAL PUBLIC LICENSE | ||
## ------------------------------------------------------------------ | ||
# | ||
## VERSION=0.1.2 | ||
## USAGE="Usage: sh magpi-issue-downloader.sh [-f firstissue] [-l lastissue]" | ||
# | ||
#Param( | ||
# [string]$f, | ||
# [string]$l | ||
#) | ||
# | ||
## control variables | ||
#$i = 1 | ||
#$baseDir = (Split-Path -Path $PSScriptRoot -Parent) | ||
#$issues = Get-Content "$baseDir\sources-for-download\regular-issues.txt" -First 1 | ||
#$baseUrl = "https://magpi.raspberrypi.org/issues/" | ||
#$web = New-Object system.net.webclient | ||
#$errorCount = 0 | ||
# | ||
## Check if directory dont exist and try create | ||
#if ( -Not (Test-Path -Path "$baseDir\issues" ) ) { | ||
# New-Item -ItemType directory -Path "$baseDir\issues" | ||
#} | ||
# | ||
# | ||
#if ($f) { | ||
# $i = [int]$f | ||
#} | ||
# | ||
#if ($l) { | ||
# $issues = [int]$l | ||
#} | ||
# | ||
#do { | ||
# #start scrapping directory and download files | ||
# | ||
# $tempCounter = if ($i -le 9) { "{0:00}" -f $i } Else { $i } | ||
# | ||
# $fileReponse = ((Invoke-WebRequest -UseBasicParsing "$baseUrl$tempCounter/pdf").Links | Where-Object { $_.href -like "http*" } | Where-Object class -eq c-link) | ||
# if ($fileReponse) { | ||
# try { | ||
# $web.DownloadFile($fileReponse.href, "$baseDir\issues\" + $fileReponse.download) | ||
# Write-Verbose -Message "Downloaded from $fileReponse.href" | ||
# } | ||
# Catch { | ||
# Write-Verbose -Message $_.Exception | format-list -force | ||
# Write-Verbose -Message "Ocorred an error trying download $fileReponse.download" | ||
# $errorCount++ | ||
# } | ||
# } | ||
# $i++ | ||
#} While ($i -le $issues) | ||
# | ||
#if ($errorCount -gt 0) { | ||
# exit 1 | ||
#} |