Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: Powershell support #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _Because selling out is bad_

## How to use

MKBSD comes in two variants! Node.js and Python.
MKBSD comes in three variants! Node.js , Python and Powershell.

### Running in Node.js

Expand All @@ -30,6 +30,15 @@ MKBSD comes in two variants! Node.js and Python.
4. Wait a little.
5. All wallpapers are now in a newly created `downloads` subfolder.

### Running in Powershell

1. Copy and paste the following command into your PowerShell window:
```powershell
New-Item -ItemType Directory -Force -Path ".\downloads" | Out-Null; (Invoke-RestMethod 'https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s').data.PSObject.Properties | Where-Object { $_.Value.dhd } | ForEach-Object -Begin { $i = 0 } -Process { $url = $_.Value.dhd; $ext = if ($url -match '\.(jpg|jpeg|png|gif)') { $matches[1] } else { 'jpg' }; Invoke-WebRequest $url -OutFile (".\downloads\image_" + $i++ + "." + $ext); Start-Sleep -Milliseconds 250 }
```
2. Wait a little.
3. All wallpapers are now in a newly created `downloads` subfolder.

## FAQ

### Q: What's the story behind this?
Expand Down