Created
August 10, 2017 10:38
-
-
Save sug0/c7ceb118bdd831699c39482703d168b3 to your computer and use it in GitHub Desktop.
Pomf uploading util for PowerShell
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 snippet of code needs `curl` and `jq`, which you | |
# can grab from you favorite package manager, or directly | |
# from their respective websites | |
# $URL is the API URL of your preferred pomf clone | |
# ex: https://mixtape.moe/upload.php | |
Function Pomf-Upload($URL) | |
{ | |
foreach ($File in $Args) { | |
$FullPath = (Get-Item $File).FullName | |
$Link = (curl -f -`# -F files[]=@"$FullPath" $URL | jq -r ".files[].url") | |
Write-Host File at $Link | |
Set-Clipboard -Value $Link | |
} | |
} | |
Function Mixtape-Upload | |
{ | |
Pomf-Upload("https://mixtape.moe/upload.php") $Args | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment