Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Get-TwitchBroadcasts($channel) {
- $limit = 100
- $total = Invoke-WebRequest "https://api.twitch.tv/kraken/channels/$channel/videos?broadcasts=true" | Select-Object -ExpandProperty Content | ConvertFrom-Json | Select-Object -ExpandProperty _total
- $videos = @()
- for ($offset = 0; $offset -lt $total; $offset += $limit) {
- $videos += Invoke-WebRequest "https://api.twitch.tv/kraken/channels/$channel/videos?broadcasts=true&offset=$offset&limit=$limit" | Select-Object -ExpandProperty Content | ConvertFrom-Json | Select-Object -ExpandProperty videos
- }
- $videos | Select-Object title, url | ConvertTo-Html | Set-Content "$channel.html"
- }
- Get-TwitchBroadcasts("tornis")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement