DailyMail: a daily e-mailed status report from your TiVo

Discussion in 'TiVo Series 1 - UK' started by sanderton, Oct 28, 2003.

  1. Oct 28, 2003 #1 of 2705
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    Note: the original version of DailyMail has now been superceded by tivo_onion's Jazz version, which can be found lower down the thread (here at the the time of writing.)

    Ian was mentioning the other day about his daily routine for checking that his TiVo was all set up for the day's recordings. I know that I haven't the patience for that - heck, I know I haven't even got the patience to check via TiVoWeb on my coffee break. If such a system was to work for me, it would have to be more pro-active.

    So I wrote this script.

    It sends me an e-mail at work every day, telling me:

    * If the TiVo has rebooted recently
    * If the last daily call failed
    * What unresolved conflicts are coming up
    * What programmes are about to expire
    * What the TiVo is planning to record that day

    Here is an example of what it sends.

    I wrote it for my own amusement, and I certainly don't want to get into a big round of bug fixing and beta testing, but I offer it here in case its of use to anyone else, or if someone wants to use it as the basis for something better.

    Most of the code is adapted, filched and straight copied from various TiVoWeb modules - if I've omitted a credit in the code my apologies. I thank those authors for their great work.

    To use it you'll need to edit the .tcl file - preferably on the TiVo using joe or vi, or on the PC if you have a Unix compatible text editor. If not you'll need to run it through DOS2UNIX or similar to get it back in Unix format. There are some variables at the top you'll need to set as a minimum:

    - the e-mail address to send the mail to
    - the IP address of your ISP's SMTP server (must be an IP as TiVo has no DNS lookup)
    - your domain name

    Some have also found it necessary to tweak the exact commands sent to the mail server - see the posts below for details if you are having problems; most have been incorporated into the code now. In particular, if your ISP mail server requires authentication see here

    The file dailymail.tcl will need to be made executable with

    chmod 755 dailymail.tcl

    You need to have TiVoWeb 1.9.4 installed - DailyMail is not compatible with the TiVoWebPlus hack, but there are workarounds, see below. And an always-on internet connection. This script will not work using the TiVo's modem - it must be able to connect to the net via your network

    I have a cron job set up to run it every morning.

    Feel free to take this code and run with it - just please post anything cool you add or fix!
     

    Attached Files:

  2. Oct 28, 2003 #2 of 2705
    bobnick

    bobnick New Member

    862
    0
    Jun 6, 2002
    London
    Will dailymail automatically include the latest number of asylum seekers and the dangers of interest rates rising, or do I need to edit the tcl file?
     
  3. Oct 28, 2003 #3 of 2705
    Lysander

    Lysander New Member

    74
    0
    Sep 18, 2003
    Bedfordshire
    Stuart,

    Two things.

    1. Haven't you got a job? (Tivo are you listening?)

    or

    2. Haven't you got a life?

    Some amazing stuff kicking around in that head of yours....:D

    James
     
  4. Oct 28, 2003 #4 of 2705
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    Great, now to make me look thick (not hard generally)?

    How do I find the IP address of my ISP's SMTP server (mail.btconnect.com)?

    my domain - I take this as the @xxxx bit

    as my emails address is xxxxxxxx@btconnect.com the domain is btconnect.com , True?


    have not a clue how to set up a a "cron job" to run it every morning. How do I get it to send every morning?

    thanks
     
  5. Oct 28, 2003 #5 of 2705
    m3geezer

    m3geezer New Member

    14
    0
    Dec 17, 2002
    how do i find the ip address of the smtp server?

    look in outlook or whatever your mail client is and see what your outgoing mailserver is called, then if you run win nt/2000/xp type on a command line 'nslookup <the server name here>'

    not sure about tivo but in unix 'crontab -e' allows you to edit the crontab, you want to make a timed entry for a specific time each day, under day you enter '*' to mean everyday, i think i'm right in saying 0 is sunday, 1 is monday, upto saturday which is 6, if you only want it on specific days.

    maybe someone can clarify this.
     
  6. Oct 28, 2003 #6 of 2705
    bobnick

    bobnick New Member

    862
    0
    Jun 6, 2002
    London
    Script works just great - cheers!

    (Eventually) tracked down Cron - http://www.tivocommunity.com/tivo-vb/showthread.php?s=&threadid=69877&highlight=cron

    Looks v. complicated - I'll have to work out how to get it to run each morning tomorrow I think! Anyone got any tips?

    BTconnect should have an IP of 193.113.154.2 - hit start, then run in windows, then type CMD and press enter. then just type ping mail.btconnect.com to find out the ip address. And yes, that's your domain - but I don't think it does anything other than form the 'From' address in the Tivo email.
     
  7. Oct 28, 2003 #7 of 2705
    randymc

    randymc New Member

    11
    0
    Aug 25, 2002
    Murfreesboro...
    I get the following error:

    object not found (errNmNameNotFound)

    while executing
    "mfs find $guideindexdir/ChannelTable"
    ("uplevel" body line 2)
    invoked from within
    "uplevel $body"
    invoked from within
    "transaction {uplevel $body}"
    (procedure "RetryTransaction" line 5)
    invoked from within
    "RetryTransaction {
    set channeltablefsid [lindex [mfs find $guideindexdir/ChannelTable] 0]
    set channeltabledata [mfs get $channeltablefsid]..."
    (procedure "init_channelindex" line 58)
    invoked from within
    "init_channelindex"
    (file "/var/hack/tivoweb-tcl/modules/index.itcl" line 658)
    invoked from within
    "source /var/hack/tivoweb-tcl/modules/index.itcl"
    (file "/var/hack/dailymail.tcl" line 445)

    Any help?

    Thanks,
    rAndy
     
  8. Oct 28, 2003 #8 of 2705
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    Thanks, think I have got it - except for the crone bit. Tool late to worry tonight ( just got back from a 9-8 penalty shoot out?).

    If anyone out there is sleepless, maybe an idiots guide exacly what I need to run on the tivo for the "cron" stuff. Got tivoweb etc etc working , but only by following idiots guides
     
  9. Oct 29, 2003 #9 of 2705
    Automan

    Automan Ex TiVo User

    4,184
    0
    Oct 29, 2000
    South...
    Try ping mail.btconnect.com from the command prompt on your PC.

    Some of the big email providers can have more than one mail server (to ease the load / increased reliability). Thus it's possible when you ping a mailserver by it's DNS name you make get a diferent IP number.

    Automan.
     
  10. Oct 29, 2003 #10 of 2705
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    Check the version3 variable at the start of the code, should be false if v2 or true if v3. No idea about v4. :)
     
  11. Oct 29, 2003 #11 of 2705
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    cron's a bit complicated.

    I did it like this (from memory so replace the xxx's with the real names!):

    1) copy the xxx.tar.gz file to /var/hack
    2) gzip -d xxx.tar.gz to get to the xxx.tar
    3) cpio -idu -H tar < xxx.tar which will create a directory of xxx
    4) cd xxx to that directory
    5) Make everything there executable with chmod 755 *
    6) There is a .sh script in the directory, run it with ./xxx.sh which will create a load of subdirectories of /var/hack
    7) Copy the crontab file (the text file which sets what cron does) to /var/hack/etc with mv crontab /var/hack/etc/crontab
    8) Copy the cron program itself to /var/hack/bin with mv cron /var/hack/bin/cron
    9) If you've followed one of the usual hacking guides /var/hack/bin will be in your path so you can now run cron with cron &, if not use /var/hack/bin/cron &
    10) Open the /var/etc/crontab file with joe or your preferred editor. The last line is an example cron job wich just modifies a file to see if its working. Delete that line, and to run dailymail.tcl every weekday at 8am add this one:

    0 8 * * 1-5 /var/hack/dailymail.tcl &

    11) So it survives reboots, add the line
    /var/hack/bin/cron &
    to rc.sysinit.author
     
  12. Oct 29, 2003 #12 of 2705
    racingclub

    racingclub New Member

    100
    0
    Oct 26, 2001
    snds a nice script - will try it later..................
     
  13. Oct 29, 2003 #13 of 2705
    Dapper Dan

    Dapper Dan Gold Member

    105
    0
    Feb 21, 2002
    Sussex, UK
    Blimey, that's good :)

    Do you have trouble sleeping with all these thoughts that keep going through your head ?
     
  14. Oct 29, 2003 #14 of 2705
    bobnick

    bobnick New Member

    862
    0
    Jun 6, 2002
    London
    Thanks for the cron help - i had to change a few bits to make it work with the cron link above, but it looks like it will work - we'll find out in the morning!

    Dailymail caused my Tivo to reboot this afternoon when it was run through a bash prompt - no idea why, sorry!
     
  15. Oct 29, 2003 #15 of 2705
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    being really thick now - what is programme xxx, anyone know the real name and where I ge it :confused:
     
  16. Oct 29, 2003 #16 of 2705
    horwitz

    horwitz New Member

    70
    0
    Jan 11, 2002

    You'll find it in the lost post of the thread pointed to here:
    Specifically, go here and get cron-3.0pl1_TiVo-2.tar.gz (that should tell you what "xxx" is, too).
     
  17. Oct 29, 2003 #17 of 2705
    bobnick

    bobnick New Member

    862
    0
    Jun 6, 2002
    London
    Read further up the thread, and follow the readme files that come with it - you'll need to change the insructions in this thread slightly (as the files go in a different place)
     
  18. Oct 29, 2003 #18 of 2705
    horwitz

    horwitz New Member

    70
    0
    Jan 11, 2002
    What do I do here? I'm sending the email to a hotmail.com address (and, as such, am using their mail server). I assume this has nothing to do with my Windows domain nor with my ISP.

    p.s. This sounds great -- exactly what I do by hand and wish I had a quick tool for!
     
  19. Oct 29, 2003 #19 of 2705
    tivo_boj

    tivo_boj Tivo is getting old

    215
    0
    Feb 10, 2001
    Pitsea,...
    Thanks,

    got it now, just configuring files to see if I can get the cron job working
     
  20. Oct 29, 2003 #20 of 2705
    sanderton

    sanderton TiVoer since 11/2000

    6,341
    0
    Jan 4, 2002
    You need to set this to be the internet domain that you are sending from and which appears in your outgoing e-mails, often something like accountname.isp.com.

    The mailserver needs to be the IP addess of your ISP's outgoing SMTP server, not hotmail. Check your e-mail client's preferences to see what the name of it is, then (as suggested above) use ping to find out the IP address.
     

Share This Page