|
| 1 | +# PowerShell script to download company logos |
| 2 | +# Run this script in the logos directory |
| 3 | + |
| 4 | +$logos = @{ |
| 5 | + "anbt-logo.png" = "https://www.anbt.dz/wp-content/themes/anbt/img/logo.png" |
| 6 | + "engie-logo.png" = "https://www.engie.com/themes/custom/engie/logo.svg" |
| 7 | + "cnr-logo.png" = "https://www.cnr.tm.fr/wp-content/uploads/2020/05/logo-cnr.png" |
| 8 | + "reor20-logo.png" = "https://www.reor20.com/wp-content/themes/reor20/images/logo.png" |
| 9 | + "cnrs-logo.png" = "https://www.cnrs.fr/themes/custom/cnrs/logo.svg" |
| 10 | + "inrae-logo.png" = "https://www.inrae.fr/themes/custom/inrae/logo.svg" |
| 11 | + "swa-logo.png" = "https://www.swa.gov.sa/themes/responsive/images/logo.png" |
| 12 | + "miyahthon-logo.png" = "https://www.waterinnovationplatform.com/wp-content/uploads/2023/01/logo.png" |
| 13 | + "idws-logo.png" = "https://idwsc.com/wp-content/uploads/2023/01/idws-logo.png" |
| 14 | +} |
| 15 | + |
| 16 | +foreach ($logo in $logos.GetEnumerator()) { |
| 17 | + $outputPath = Join-Path $PSScriptRoot $logo.Key |
| 18 | + Write-Host "Downloading $($logo.Key) from $($logo.Value)" |
| 19 | + |
| 20 | + try { |
| 21 | + Invoke-WebRequest -Uri $logo.Value -OutFile $outputPath -ErrorAction Stop |
| 22 | + Write-Host "✓ Successfully downloaded $($logo.Key)" -ForegroundColor Green |
| 23 | + } |
| 24 | + catch { |
| 25 | + Write-Host "✗ Failed to download $($logo.Key): $($_.Exception.Message)" -ForegroundColor Red |
| 26 | + |
| 27 | + # Create a fallback text-based logo |
| 28 | + $fallbackPath = [System.IO.Path]::ChangeExtension($outputPath, ".svg") |
| 29 | + $companyName = [System.IO.Path]::GetFileNameWithoutExtension($logo.Key).Replace("-logo", "").ToUpper() |
| 30 | + |
| 31 | + $svgContent = @" |
| 32 | +<svg width="150" height="80" xmlns="http://www.w3.org/2000/svg"> |
| 33 | + <rect width="150" height="80" fill="#2c3e50" rx="8"/> |
| 34 | + <text x="75" y="45" text-anchor="middle" fill="white" font-family="Arial, sans-serif" font-size="14" font-weight="bold">$companyName</text> |
| 35 | +</svg> |
| 36 | +"@ |
| 37 | + |
| 38 | + $svgContent | Out-File -FilePath $fallbackPath -Encoding UTF8 |
| 39 | + Write-Host "✓ Created fallback SVG logo for $($logo.Key)" -ForegroundColor Yellow |
| 40 | + } |
| 41 | +} |
| 42 | + |
| 43 | +Write-Host "`nLogo download complete! Check the logos folder for the images." -ForegroundColor Green |
| 44 | +Write-Host "Note: You may need to manually download some logos from company websites if the automated download fails." -ForegroundColor Yellow |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
0 commit comments