Closed zag2me closed 7 years ago
Some info and possible fix here, something about setting the referal header. I wonder if thats even possible in Powershell?
https://www.reddit.com/r/nba/comments/3k91g5/finally_some_documentation_for_the_statsnbacom_api/
Fixed, pull the latest version.
Getting a new error now
Invoke-WebRequest : The 'Referer' header must be modified using the appropriate property or method. Parameter name: name At C:\Parse-NBA.ps1:15 char:11
- CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ArgumentException
- FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
What version of powershell are you using? (type $psversiontable in your powershell console) it works on mine, Windows 10,powershell 5.1.
On Sun, 13 Nov 2016, 6:37 p.m. Zag, notifications@github.com wrote:
Getting a new error now
Invoke-WebRequest : The 'Referer' header must be modified using the appropriate property or method. Parameter name: name At C:\Parse-NBA.ps1:15 char:11
- $teams = (Invoke-WebRequest $teamUrl -WebSession $websession | ConvertFrom-Json) ...
- CategoryInfo : NotSpecified: (:) [Invoke-WebRequest], ArgumentException - FullyQualifiedErrorId : System.ArgumentException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
— You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub https://github.com/mmmmmtasty/SportScanner/issues/18#issuecomment-260203280, or mute the thread https://github.com/notifications/unsubscribe-auth/ANdfTrhihIW7SSiikUYWjOtHLIlpIhBzks5q91iWgaJpZM4KwbRU .
Windows 2008 so Powershell 3.0
I'm guessing it can't do that.
I'll investigate upgrading.
Can you add the following between line 11 and 12 and send me the output?
$websession
return
output.
Headers : {} Cookies : System.Net.CookieContainer UseDefaultCredentials : False Credentials : Certificates : UserAgent : Mozilla/5.0 (Windows NT; Windows NT 6.0; en-GB) WindowsPowerShell/3.0 Proxy : MaximumRedirection : -1
No go on the upgrade unfortunately. This page seems to indicate 3.0 is the last Powershell version available for 2008 :(
I'm guessing the function was introduced in 4.0
Should be moving to a new 2016 server soon so I will get this up and running as soon as possible ;)
Now that the season has restarted, looks like there is an error with the NBA.com API.
PS C:> .\nba.ps1 Invoke-WebRequest : Access Denied You don't have permission to access "http://stats.nba.com/stats/scoreboard/?" on this server. Reference #18.1e6f5668.1478959690.724c4e8 At C:\nba.ps1:38 char:17