Roku External Control API package for Golang
Rick Roll all roku devices on the network that have YouTube installed.
dQw4w9WgXcQ
is the contentID of "Never Gonna Give You Up" on YouTube
package main
import "github.com/picatz/roku"
func main() {
devices, err := roku.Find(roku.DefaultWaitTime)
if err != nil {
panic(err)
}
for _, device := range devices {
apps, err := device.Apps()
if err != nil {
panic(err)
}
for _, app := range apps {
if app.ID == roku.YouTubeAppID {
device.LaunchApp(app.ID, roku.Params{
"contentID": "dQw4w9WgXcQ",
})
}
}
}
}
On supported devices, you can make the remote beep.
package main
import "github.com/picatz/roku"
func main() {
devices, err := roku.Find(roku.DefaultWaitTime)
if err != nil {
panic(err)
}
for _, device := range devices {
device.FindRemote()
}
}