Skip to content

Instantly share code, notes, and snippets.

@sug0
Created August 10, 2017 10:38
Show Gist options
  • Save sug0/c7ceb118bdd831699c39482703d168b3 to your computer and use it in GitHub Desktop.
Save sug0/c7ceb118bdd831699c39482703d168b3 to your computer and use it in GitHub Desktop.
Pomf uploading util for PowerShell
# 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