SageTV Community  

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

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-21-2013, 10:13 PM
IVB's Avatar
IVB IVB is offline
Sage Icon
 
Join Date: Sep 2003
Location: Oak-town, CA
Posts: 1,083
Email on new SageTV File

The one thing i like about HuluPlus is that it emails me when a new show is in my queue.

Has anyone found a way to have a program email them upon discovering a new file in the TV directory? Google reveals some, but nothing that seems trustworthy.
__________________
------------------------------------
My Home Automation YouTube channel
Reply With Quote
  #2  
Old 10-22-2013, 06:41 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
You can use dirmon to do something like that in Windows.
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #3  
Old 10-23-2013, 11:27 PM
IVB's Avatar
IVB IVB is offline
Sage Icon
 
Join Date: Sep 2003
Location: Oak-town, CA
Posts: 1,083
cool thanks
__________________
------------------------------------
My Home Automation YouTube channel
Reply With Quote
  #4  
Old 10-26-2013, 01:27 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I am sure that you could probably do this with SJQ as well. I have my system send me an email at midnight detailing the next day's recordings. I also put in hyperlinks so that I can quickly check out more info.

The emails look like this:
Quote:
TV Recording Schedule for: Friday Oct 25 12:00 AM to Saturday Oct 26 12:00 AM
-----------------------------------------------------------------------------
02:00AM to 04:30AM
Rugby - ITM Cup - Championship Final: Tasman vs. Hawke's Bay The show is airing on STNTAHD
http://myserver.dyndns.org:8080/sage...ingId=18875133

02:45PM to 05:00PM
Premiership Rugby - Bath vs. Gloucester
The show is airing on SNWLHD2
http://myserver.dyndns.org:8080/sage...ingId=18857433

07:00PM to 09:30PM
NHL Hockey - Toronto Maple Leafs at Columbus Blue Jackets - SRE is monitoring The show is airing on LEAFSHD
http://myserver.dyndns.org:8080/sage...ingId=18757260

10:30PM to 12:30AM
Rugby - French Top 14: Bayonne vs. Montpellier The show is airing on STNTAHD
http://myserver.dyndns.org:8080/sage...ingId=18833760

To edit go to: http://myserver.dyndns.org:8080/sage/Home
or for mobile: http://myserver.dyndns.org:8080/sagem/m/menu.js
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #5  
Old 12-09-2013, 12:54 AM
IVB's Avatar
IVB IVB is offline
Sage Icon
 
Join Date: Sep 2003
Location: Oak-town, CA
Posts: 1,083
Quote:
Originally Posted by wayner View Post
I am sure that you could probably do this with SJQ as well. I have my system send me an email at midnight detailing the next day's recordings. I also put in hyperlinks so that I can quickly check out more info.

The emails look like this:
I'm trying to learn about SJQ but its slow going. Any chance you can get me the script for that so I can see how its built?
__________________
------------------------------------
My Home Automation YouTube channel
Reply With Quote
  #6  
Old 12-09-2013, 08:53 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I am travelling for a few days but I will post my code when I return.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #7  
Old 12-09-2013, 09:56 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
OK, back home and here is the code:

Code:
/*
    Daily Email for Sage Recordings
    Last Modified: 14 Jan 2012
           Author:  Wayner although I steal most of the code from...
           Derek Battams <derek AT battams DOT ca>
    
    Run this script daily to produce a report of the day's upcoming recordings.
    Each show includes a link to the web interface, which will allow you to record the
    airing, if so desired.
    
    This script requires SRE as it notes if SRE is monitoring the recording.
    If running from the SageGroovy environment make sure to copy all SRE JAR files
    to the Sagegroovy/lib folder.
    
    I set this to email at 12:01 every morning.
    
    You MUST change the settings below, especially the email settings if you want
    this script to email the output.  The script is written for the SJQv4
    environment and expects it is running in that environment.
*/

import com.google.code.sagetvaddons.sre.engine.DataStore
def BASE_URL = 'http://myserver.dyndns.org:8080/sage' // Base URL to web interface, with NO trailing slash
def sageweburl = BASE_URL+'/Home'  // This is where the Sage Web home page resides
def sagemobweburl= 'http://myserver.dyndns.org:8080/sagem/m/menu.js' // Same for the Sage mobile web page

private class EmailSettings {
    static def sendMail = true                  // Set this to false to just dump the alert msg to stdout instead of emailing it
    static def host = 'smtp.gmail.com'
    static def user = 'fred.flinstone@gmail.com'
    static def pwd  = 'Wilma'
    static def port = '465'
    static def subj = 'Sage Recordings for Today'
    static def from = user                       // Gmail will reject mail via SMTP if the from addr != user id so no point in changing this
    static def to   = 'fred.flinstone@gmail.com'           // Sometimes Gmail won't send an email addressed to yourself, try a plus address at the end; YMMV
    static def ssl  = 'true'                     // Gmail requires SSL, other SMTP servers may or may not; this is a STRING setting!

}

def sendMail(def msg) {
   def ant = new AntBuilder()
   ant.mail(mailhost: EmailSettings.host, mailport: EmailSettings.port, subject: EmailSettings.subj, user: EmailSettings.user, password: EmailSettings.pwd, ssl: "true") {
       from(address: EmailSettings.from)
       to(address: EmailSettings.to)
       message(msg)   
   }
}

def start = new Date()
start[Calendar.HOUR_OF_DAY] = 0
start[Calendar.MINUTE] = 0
start[Calendar.SECOND] = 0
def end = new Date(start.getTime() + 1L*1000L *3600L * 24L) // 1 day * 1000ms/s * 3600s/hr * 24hr/day
def shows = new HashSet()
def airings = []
airings=Global.GetScheduledRecordingsForTime(start.getTime(), end.getTime()) 
def datastore = DataStore.getInstance()
def msg = new StringBuilder()
StartTime=start.format('EEEE MMM d hh:mm a')
EndTime=end.format('EEEE MMM d hh:mm a')

msg <<"TV Recording Schedule for: $StartTime to $EndTime\n"
msg <<"-----------------------------------------------------------------------------\n"
airings.each {
    msg << "${new Date(AiringAPI.GetAiringStartTime(it)).format('hh:mma')} to ${new Date(AiringAPI.GetAiringEndTime(it)).format('hh:mma')}\n"
    msg << "${ShowAPI.GetShowTitle(it)} - "

    SRE1 = datastore.getMonitorStatusByObj(it)
    SRE = SRE1.toString()
    if (SRE == "NO_MONITOR") {
        msg << "${ShowAPI.GetShowEpisode(it)}\n"}
    else {
        msg << "${ShowAPI.GetShowEpisode(it)} - SRE is monitoring\n"}
    msg << "${BASE_URL}/DetailedInfo?AiringId=${AiringAPI.GetAiringID(it)}\n\n"
}
 msg << "To edit go to: $sageweburl\n"
 msg << "or for mobile: $sagemobweburl\n"
if(EmailSettings.sendMail && msg.toString())
    sendMail(msg.toString())
else if(msg.toString())
    println msg
return 0
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #8  
Old 12-09-2013, 10:15 PM
IVB's Avatar
IVB IVB is offline
Sage Icon
 
Join Date: Sep 2003
Location: Oak-town, CA
Posts: 1,083
awesome thanks!
__________________
------------------------------------
My Home Automation YouTube channel
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with email updates from SagetV forums wayner General Discussion 4 12-01-2011 09:21 AM
Sagemc email blwegrzyn SageMC Custom Interface 1 05-30-2009 10:55 AM
@email SageGk SageMC Custom Interface 13 06-17-2008 09:51 AM
Use main work/email/web computer as SageTV server? misterj Hardware Support 7 08-15-2007 12:15 AM
Email Plugin? Tony414 SageTV Customizations 0 01-27-2005 02:31 PM


All times are GMT -6. The time now is 07:03 PM.


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