Requirements:
- SSH Access to your server (OpenSSH Private Key)
- Full permissions to the folder you want to upload meme's to (Root shouldn't be required)
- A domain to serve meme's from
wget
installed on your server
# Replace all values below with your own else it'll error.
#################################################################
$PrivateKey = 'location_to_private_key'
$ServerIp = 'server_ip'
$Username = 'username_on_server'
$MemeDir = 'location_to_meme_directory'
$MemeBaseUrl = 'base_url_for_domain_to_meme_directory' # Include protocol (http:// or https://). Do not keep a `/` in the end of the url. Example: `https://memes.bongo.ninja`
#################################################################
$Meme = Read-Host -Prompt 'Input the meme URL'
ssh -i $PrivateKey $Username@$ServerIp "wget $Meme -P $MemeDir"
$MemeUrl = $MemeBaseUrl + "/" + $Meme.Split("/")[-1]
Set-Clipboard -Value $MemeUrl
Write-Output ("Successfully stole the meme and copied the URL to your clipboard!")
Write-Output ("URL: " + $MemeUrl)
You can either insert this as a function in your PowerShell PROFILE or make a .ps1
file containing the script and add the file's location to your PATH.