-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
243 additions
and
177 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
Option Explicit | ||
|
||
' This is a simple barebones GET for VBScript | ||
' It works for me in Win7-64. | ||
|
||
' I put the HttpRequest.dll from here into SysWOW64 and registered it with regsvr32.exe. | ||
|
||
' Be sure to run using the 32-bit cscript, if you have a 64-bit OS | ||
' C:\Windows\SysWOW64\cscript.exe GetGoogle.vbs | ||
|
||
Dim URL : URL = "https://www.google.com" | ||
|
||
With CreateObject("HttpRequest.cHttpRequest") | ||
.Open_ "GET", URL | ||
.Send | ||
|
||
If .Status = 200 Then | ||
msgbox "RESPONSE : " & .responseText | ||
Else | ||
msgbox "Oops, Status : " & .Status | ||
End If | ||
End With | ||
Option Explicit | ||
|
||
' This is a simple barebones GET for VBScript | ||
' It works for me in Win7-64. | ||
|
||
' I put the HttpRequest.dll from here into SysWOW64 and registered it with regsvr32.exe. | ||
|
||
' Be sure to run using the 32-bit cscript, if you have a 64-bit OS | ||
' C:\Windows\SysWOW64\cscript.exe GetGoogle.vbs | ||
|
||
Dim URL : URL = "https://www.google.com" | ||
|
||
With CreateObject("HttpRequest.cHttpRequest") | ||
.Open_ "GET", URL | ||
.Send | ||
|
||
If .Status = 200 Then | ||
msgbox "RESPONSE : " & .responseText | ||
Else | ||
msgbox "Oops, Status : " & .Status | ||
End If | ||
End With |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
Option Explicit | ||
|
||
' This script sets or unsets someone to be a VIP in a Twitch channel. | ||
' It works for me in Win7-64. | ||
' I put the HttpRequest.dll from here into SysWOW64 and registered it with regsvr32.exe. | ||
|
||
' Example: | ||
' C:\Windows\SysWOW64\cscript.exe TwitchVIP.vbs 1 username | ||
' will set username as VIP. (0 to remove) | ||
|
||
Dim clientid, apioauth, broadcasterid | ||
' Note: These need to be set, and the oAuth needs to permit this action, | ||
' but that's outside the scope of this example | ||
|
||
Dim URL, userid | ||
URL = "https://api.twitch.tv/helix/users?login=" & WScript.Arguments(1) | ||
|
||
With CreateObject("HttpRequest.cHttpRequest") | ||
.Open_ "GET",URL | ||
.setRequestHeader "Client-Id",clientid | ||
.setRequestHeader "Authorization", "Bearer " & apioauth | ||
.Send | ||
|
||
' msgbox "RESPONSE : " & .responseText | ||
If .Status = 200 Then | ||
Dim y, html : Set html = CreateObject("htmlfile") | ||
Dim w : Set w = html.parentWindow | ||
w.execScript "var json=" & .responseText & ";var e=new Enumerator(json.data);", "JScript" | ||
While Not w.e.atEnd() | ||
Set y = w.e.item() | ||
userid=y.id | ||
w.e.moveNext | ||
Wend | ||
End If | ||
End With | ||
|
||
With CreateObject("HttpRequest.cHttpRequest") | ||
URL = "https://api.twitch.tv/helix/channels/vips" | ||
If WScript.Arguments(0) = 1 Then | ||
.open_ "POST",URL | ||
Else | ||
.open_ "DELETE",URL | ||
End If | ||
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" | ||
.setRequestHeader "Authorization", "Bearer " & apioauth | ||
.setRequestHeader "Client-ID",clientid | ||
.send "broadcaster_id=" & broadcasterid & "&user_id=" & userid | ||
|
||
' msgbox .responseText | ||
|
||
Option Explicit | ||
|
||
' This script sets or unsets someone to be a VIP in a Twitch channel. | ||
' It works for me in Win7-64. | ||
' I put the HttpRequest.dll from here into SysWOW64 and registered it with regsvr32.exe. | ||
|
||
' Example: | ||
' C:\Windows\SysWOW64\cscript.exe TwitchVIP.vbs 1 username | ||
' will set username as VIP. (0 to remove) | ||
|
||
Dim clientid, apioauth, broadcasterid | ||
' Note: These need to be set, and the oAuth needs to permit this action, | ||
' but that's outside the scope of this example | ||
|
||
Dim URL, userid | ||
URL = "https://api.twitch.tv/helix/users?login=" & WScript.Arguments(1) | ||
|
||
With CreateObject("HttpRequest.cHttpRequest") | ||
.Open_ "GET",URL | ||
.setRequestHeader "Client-Id",clientid | ||
.setRequestHeader "Authorization", "Bearer " & apioauth | ||
.Send | ||
|
||
' msgbox "RESPONSE : " & .responseText | ||
If .Status = 200 Then | ||
Dim y, html : Set html = CreateObject("htmlfile") | ||
Dim w : Set w = html.parentWindow | ||
w.execScript "var json=" & .responseText & ";var e=new Enumerator(json.data);", "JScript" | ||
While Not w.e.atEnd() | ||
Set y = w.e.item() | ||
userid=y.id | ||
w.e.moveNext | ||
Wend | ||
End If | ||
End With | ||
|
||
With CreateObject("HttpRequest.cHttpRequest") | ||
URL = "https://api.twitch.tv/helix/channels/vips" | ||
If WScript.Arguments(0) = 1 Then | ||
.open_ "POST",URL | ||
Else | ||
.open_ "DELETE",URL | ||
End If | ||
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" | ||
.setRequestHeader "Authorization", "Bearer " & apioauth | ||
.setRequestHeader "Client-ID",clientid | ||
.send "broadcaster_id=" & broadcasterid & "&user_id=" & userid | ||
|
||
' msgbox .responseText | ||
|
||
End With |
Oops, something went wrong.