PSRAW
2.0.0.0
PowerShell Reddit API Wrapper. See the project site at https://github.com/markekraus/PSRAW and the documentation at https://psraw.readthedocs.io/
Minimum PowerShell version
5.0
Installation Options
Author(s)
Mark Kraus
Copyright
(c) 2017. All rights reserved.
Package Details
Owners
Tags
Reddit API OAuth REST SocialMedia Forum Messaging Module PSRAW Class
Functions
Invoke-RedditRequest Export-RedditApplication Import-RedditApplication New-RedditApplication Connect-Reddit Export-RedditOAuthToken Get-RedditDefaultOAuthToken Get-RedditOAuthScope Import-RedditOAuthToken Request-RedditOAuthToken Set-RedditDefaultOAuthToken Update-RedditOAuthToken
Dependencies
This module has no dependencies.
Release Notes
# Version 2.0.0.0 (2017-08-13)
## Module Manifest
* All `RequiredAssemblies` have been removed
## Root Module
* Added `$PSDefaultParameterValues` for `Invoke-WebRequest` to set `-SkipHeaderValidation` if available (for backwards compatibility with 5.1)
* Added `$PsrawSettings` module scope hashtable variable to house settings such as the session default OAuth token.
## Public Functions
### Connect-Reddit
* Added to Streamline and simplify the initial OAUth process.
### Export-RedditOAuthToken
* All parameters are no longer mandatory to accommodate exporting the default token to its default path
### Get-RedditDefaultOAuthToken
* Added to retrieve the Default token for the session
### Import-RedditOAuthToken
* Now returns nothing by default. Use `-PassThru` to return the imported token
* Sets the imported token as the session default Token.
### Invoke-RedditRequest
* Now has `irr` alias to mimic `iwr` and `irm` aliases.
* `Invoke-WebRequest` error handling logic reworked to support 5.1 and 6.0
* Access token is no longer mandatory and uses the session default AccessToken if one is not supplied
### New-RedditApplication
* Default Parameter Set changed to `Script`
* `Name` parameter is no longer Mandatory to simplify connecting
* `Scope` parameter has been deprecated and is no longer Mandatory
* `UserAgent` no longer mandatory. default is now `PowerShell:PSRAW:2.0 (by /u/markekraus)`
### Request-RedditOAuthToken
* Now returns nothing by default. Use `-PassThru` to return the token
* Sets the retrieved token as the session default token.
* `Code` and `Implicit` parameter sets have been removed.
* `Code` and `Implicit` parameters have been removed
* `Code` and `Implicit` grants flows have been removed
* `State` parameter has been removed (was only required for Implicit grants)
### Set-RedditDefaultOAuthToken
* Added to set the session default token
### Update-RedditOAuthToken
* `-AccessToken` is no longer mandatory and the default is the session default token
* `Code` and `Implicit` grants flows have been removed
* `-SetDefault` switch added to set the updated token as the session default token.
## Private Functions
### Get-HttpResponseContentType
* Added `Get-HttpResponseContentType` to get API response `Content-Type` as 6.0 and 5.1 currently house this in different locations.
### Request-RedditOAuthCode
* Removed `Request-RedditOAuthCode` as it is no needed without Code grant flow
### Request-RedditOAuthTokenClient
* Now returns a `RedditOAuthResponse`
### Request-RedditOAuthTokenCode
* Removed `Request-RedditOAuthTokenCode` as it is not needed without Code grant flow
### Request-RedditOAuthTokenImplicit
* Removed `Request-RedditOAuthTokenImplicit` as it is not needed without Implicit grant flow
### Request-RedditOAuthTokenInstalled
* Now returns a `RedditOAuthResponse`
### Request-RedditOAuthTokenPassword
* Now returns a `RedditOAuthResponse`
### Request-RedditOAuthTokenRefresh
* Removed `Request-RedditOAuthTokenRefresh` as it is no longer needed without Code grant flow
### Show-RedditOAuthWindow
* Removed `Show-RedditOAuthWindow` as it is not compatible with Core (this is why Code and Implicit grant flows are no longer available)
## Classes
### RedditApplication
* `Scope` is now hidden as it serves no purpose without Code grant flows.
* Removed `GetAuthorizationUrl()` and `_GetAuthorizationUrl()` as they depended on `System.Web` (not available in Core) and are not needed without the Code or Implicit grant flows.
### ReditOAuthCode
* This class has been deleted as it is not needed without the Code grant flow.
### RedditOAuthResponse
* Created `RedditOAuthResponse` class to abstract the OAuth response from Reddit.
### RedditOAuthToken
* Removed RefreshCredential (not needed without Code grant flow)
* Constructors now take a `RedditOAuthResponse` instead of a `PSobject` and the code adjusted to use its properties
* `GetRefreshToken()` Removed (not needed without Code grant flow)
* `Refresh()` now takes a `RedditOAuthResponse`
* `UpdateRateLimit()` adjusted to support both 5.1 and 6.0 style headers dictionaries.
* Default constructor now sets the GUID to `[GUID]:Empty`
### RedditApiResponse
* `Response` and `ContentObject` are now appropriately typed
* Added `ContentType`property to hold the `Content-Type` information
### RedditDate
* Added `RedditDate` class to handle unix-to-date and date-to-unix translations for dates returned from the API.
### RedditThing
* Added `RedditThing` class to work with "Reddit Things" returned from the Reddit API
### RedditModReport
* Added `RedditModReport` to house moderator reports
### RedditUserReport
* Added `RedditUserReport` to house user reports
### RedditComment
* Added `RedditComment` to house comments.
## Enums
### RedditOAuthGrantType
* Removed `Authorization_Code`, `Refresh_Token`, and `Implicit` which are not needed without Code and Implicit grant flows
### RedditThingKind
* Added `RedditThingKind` to Define "Reddit Thing" "Kind" (their terms, not mine)
### RedditThingPrefix
* Added `RedditThingPrefix` to define valid prefixes for "Reddit Things"
FileList
- PSRAW.nuspec
- PSRAW.psd1
- PSRAW.psm1
- Classes\001-RedditOAuthScope.ps1
- Classes\002-RedditApplication.ps1
- Classes\003-RedditOAuthResponse.ps1
- Classes\004-RedditOAuthToken.ps1
- Classes\005-RedditApiResponse.ps1
- Classes\006-RedditDate.ps1
- Classes\007-RedditThing.ps1
- Classes\008-RedditModReport.ps1
- Classes\008-RedditUserReport.ps1
- Classes\009-RedditComment.ps1
- en-US\about_RedditApiResponse.help.txt
- en-US\about_RedditApplication.help.txt
- en-US\about_RedditApplicationType.help.txt
- en-US\about_RedditComment.help.txt
- en-US\about_RedditDate.help.txt
- en-US\about_RedditModReport.help.txt
- en-US\about_RedditOAuthDuration.help.txt
- en-US\about_RedditOAuthGrantType.help.txt
- en-US\about_RedditOAuthResponse.help.txt
- en-US\about_RedditOAuthResponseType.help.txt
- en-US\about_RedditOAuthScope.help.txt
- en-US\about_RedditOAuthToken.help.txt
- en-US\about_RedditThing.help.txt
- en-US\about_RedditThingKind.help.txt
- en-US\about_RedditThingPrefix.help.txt
- en-US\about_RedditUserReport.help.txt
- en-US\PSRAW-help.xml
- Enums\RedditApplicationType.ps1
- Enums\RedditOAuthDuration.ps1
- Enums\RedditOAuthGrantType.ps1
- Enums\RedditOAuthResponseType.ps1
- Enums\RedditThingKind.ps1
- Enums\RedditThingPrefix.ps1
- Private\API\Wait-RedditApiRateLimit.ps1
- Private\HTTP\Get-HttpResponseContentType.ps1
- Private\OAuth\Get-AuthorizationHeader.ps1
- Private\OAuth\Request-RedditOAuthTokenClient.ps1
- Private\OAuth\Request-RedditOAuthTokenInstalled.ps1
- Private\OAuth\Request-RedditOAuthTokenPassword.ps1
- Public\API\Invoke-RedditRequest.ps1
- Public\Application\Export-RedditApplication.ps1
- Public\Application\Import-RedditApplication.ps1
- Public\Application\New-RedditApplication.ps1
- Public\OAuth\Connect-Reddit.ps1
- Public\OAuth\Export-RedditOAuthToken.ps1
- Public\OAuth\Get-RedditDefaultOAuthToken.ps1
- Public\OAuth\Get-RedditOAuthScope.ps1
- Public\OAuth\Import-RedditOAuthToken.ps1
- Public\OAuth\Request-RedditOAuthToken.ps1
- Public\OAuth\Set-RedditDefaultOAuthToken.ps1
- Public\OAuth\Update-RedditOAuthToken.ps1
Version History
Version | Downloads | Last updated |
---|---|---|
2.0.0.0 (current version) | 3,344 | 8/13/2017 |
1.1.0.7 | 75 | 5/27/2017 |
1.1.0.6 | 27 | 5/26/2017 |
1.1.0.5 | 27 | 5/26/2017 |