Last active
March 15, 2018 15:47
-
-
Save markekraus/1a8d06bb54691161f2500180ee55de71 to your computer and use it in GitHub Desktop.
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
Install-Module PSRAW -Scope CurrentUser | |
Import-Module PSRAW | |
# Go here https://ssl.reddit.com/prefs/apps | |
# use https://127.0.0.1 for redirect uri | |
# register Script App and note client id and secret | |
Connect-Reddit | |
$Params = @{ | |
Uri = 'https://oauth.reddit.com/api/compose' | |
Method = 'POST' | |
Body = @{ | |
'api_type' = 'json' | |
'subject' = 'Test Message' | |
'text' = 'This is a test from PSRAW!' | |
'to' = 'SomeRedditUser' | |
} | |
ContentType = 'application/x-www-form-urlencoded' | |
} | |
$result = Invoke-RedditRequest @params |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment