SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-29-2006, 02:10 PM
rickw rickw is offline
Sage Advanced User
 
Join Date: Aug 2004
Location: Spring Hill, TN
Posts: 108
Smile 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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 10:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.