|
SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Access Sage data using Windows Powershell
This is kind of a solution in search of a problem, but I thought it was cool. I've got my Sage box setup with the web server and I've also been learning Windows Powershell. The idea hit me could I use Powershell to query my recordings. Here's the result.
----------- Start Powershell commands ------------ $url= "http://yourserver:8080/sage/Recordings?xml=yes" $webclient=New-Object System.Net.WebClient $cred = new-object system.net.networkcredential "user", "password" $webClient.Credentials = $cred [xml]$data=$webclient.DownloadString($url) ----------- End Powershell commands ------------ The $data variable will now contain the XMLDocument of your recordings. Here's a couple things you can do with it: Sorted list with Title and Episode $data.sageShowInfo.showlist.show | select title, episode | sort title,episode Shows with a specific rating $data.sageShowInfo.showlist.show | where {$_.airing.ratings.rating -eq "TVPG"} | select title, episode Still looking for a good purpose for it, but sometimes it's just to fun play |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|