PDA

View Full Version : Writing first program



BrianS
09-09-2006, 11:39 AM
I am a C/C++ developer whose going to write his first Tcl script today.

All I want to do is iterate the 'Now Showing' and with each show create a .asx file and put it in a network shared folder.

I've been looking at TivoWebPlus and know from the nowshowing page this is done cause I can save the .asx from the View link. In the code I've come across use of sub ForeachMfsFile and will see if this is the route to go.

Can anyone point me to a basic sample starting with just lising 'Now Showing' via a telnet session?

Thanx,

Jamie
09-09-2006, 11:46 AM
Can anyone point me to a basic sample starting with just lising 'Now Showing' via a telnet session?There's a NowShowing.tcl script floating around that used to be used by tserver. Look in the src package here (http://www.dealdatabase.com/forum/showthread.php?t=39487). There's a C version too. Faster, but it is kind of ugly. See also mfs_streams from the same package.

BrianS
09-09-2006, 01:16 PM
There's a NowShowing.tcl script floating around that used to be used by tserver. Look in the src package here (http://www.dealdatabase.com/forum/showthread.php?t=39487). There's a C version too. Faster, but it is kind of ugly. See also mfs_streams from the same package.


Thanx ... looks to be a good place to start.
Headed over to Borders to pick up a Tcl book; the O'Reilly one looks well worth the 40 bucks.

...

I must be missing something, just tried my first Hello World, created the .tcl file, did the chmod 755 and got an error when running it

The MyFirst.tcl is

###############################################################################
# my first tivo app

puts stdout "Hello World"

# Done.

And the error I get when running it is:
: command not found
.//MyFirst.tcl: puts: command not found
: command not found

Any ideas?

ScanMan
09-09-2006, 02:55 PM
I think you have to add:
#!/tvbin/tivoshas the 1st line...

BrianS
09-09-2006, 05:07 PM
I think you have to add:
#!/tvbin/tivoshas the 1st line...

I added the line and it still would not run ...

understanding tivosh to be a command line interpreter I tried 'tivosh MyAlert.tcl'

... and that ran correctly. Not sure why my addition of #!/tvbin/tivosh is being ignored.

ScanMan
09-09-2006, 05:28 PM
I added the line and it still would not run ...

understanding tivosh to be a command line interpreter I tried 'tivosh MyAlert.tcl'

... and that ran correctly. Not sure why my addition of #!/tvbin/tivosh is being ignored.That's funny because I tried it and it ran fine for me; on a 240 SA tivo. :confused:


#!/tvbin/tivosh
puts stdout "Hello World"

Jamie
09-09-2006, 05:33 PM
I added the line and it still would not run ...

understanding tivosh to be a command line interpreter I tried 'tivosh MyAlert.tcl'

... and that ran correctly. Not sure why my addition of #!/tvbin/tivosh is being ignored.A common problem is that the "pound bang" line (#!) is not the first line of the file, or the file does not have unix line terminations. The dos2unix program can take care of the second problem.

BrianS
09-09-2006, 05:50 PM
A common problem is that the "pound bang" line (#!) is not the first line of the file, or the file does not have unix line terminations. The dos2unix program can take care of the second problem.

Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you Thank you...

...I was going nuts trying to figure out what it was I was doing. I ran to Borders, picked up a Tcl book (and some Tivo books) and still couldn't figure it out.

Now the next big question and I will be on my way to completing my first utility.

Can I make a folder on the Tivo that is accessible as a share on my network? I have ftp running and can ftp to the Tivo but for my needs I am looking to use UNC e.g. '\\192.168.1.22\var\hack\foldershare'

Thanx

cheer
09-09-2006, 05:55 PM
I believe some have gotten Samba to run on a Tivo, though I vaguely recall that it was buggy. Might be simpler to use a freeware utility to make an ftp connection look like an attached drive.

BrianS
09-09-2006, 06:42 PM
I believe some have gotten Samba to run on a Tivo, though I vaguely recall that it was buggy. Might be simpler to use a freeware utility to make an ftp connection look like an attached drive.

I think for a first round I am going to go the other direction which is to try and mount on the Tivo a share from my Windows box then write the files there.