View Full Version : Batch file to help with Juice podcast aggregator
Jonathan Berry
February 28th 07, 05:32 PM
Juice, the open source free podcast aggregator, is pretty good. I
have two problems with it, and one solution:
1. There is no way to temporarily deactivate a source. You have to
delete it.
2. Juice provides no way to get the podcasts (all stored in separate
folders) onto your mp3 device. Here is a batch file that will do it:
----------snip
:: usage: juice 2 21 copies all podcast files newer than Feb 20th to
music subd
IF "%2"=="" goto file
xxcopy c:\download\podcasts\*.mp3 i:\music /D:%1-%2-2007 /SG
goto end
:file
echo usage: juice 2 21 copies all podcast files newer than Feb 20th
to music su
:end
----------- snip
requires xxcopy (free program), assumes that the device is recognized
as drive i: and that you want to store the files in folder \music
assumes that juice stores the podcasts in subdirectories of c:\download
\podcasts. The /SG switch 'gathers' the new files in the
subdirectories.
The /D: switch copies only files not older than the given date, which
you have to provide. An improvement would be for the batch file to
write today's date to a file and then read it back the next time.
Then the user wouldn't have to enter parameters or run it from the
command line.
Some mp3 devices don't do Windows, but mine, a cowon iaudio, does.
Further suggestions welcome!
--
Jonathan Berry
Todd Vargo
February 28th 07, 08:55 PM
"Jonathan Berry" > wrote in message
oups.com...
> Juice, the open source free podcast aggregator, is pretty good. I
> have two problems with it, and one solution:
>
> 1. There is no way to temporarily deactivate a source. You have to
> delete it.
>
> 2. Juice provides no way to get the podcasts (all stored in separate
> folders) onto your mp3 device. Here is a batch file that will do it:
>
> ----------snip
> :: usage: juice 2 21 copies all podcast files newer than Feb 20th to
> music subd
>
> IF "%2"=="" goto file
> xxcopy c:\download\podcasts\*.mp3 i:\music /D:%1-%2-2007 /SG
>
> goto end
> :file
> echo usage: juice 2 21 copies all podcast files newer than Feb 20th
> to music su
> :end
> ----------- snip
> requires xxcopy (free program), assumes that the device is recognized
> as drive i: and that you want to store the files in folder \music
>
> assumes that juice stores the podcasts in subdirectories of c:\download
> \podcasts. The /SG switch 'gathers' the new files in the
> subdirectories.
> The /D: switch copies only files not older than the given date, which
> you have to provide. An improvement would be for the batch file to
> write today's date to a file and then read it back the next time.
> Then the user wouldn't have to enter parameters or run it from the
> command line.
>
> Some mp3 devices don't do Windows, but mine, a cowon iaudio, does.
>
> Further suggestions welcome!
First suggestion, you appear to be using Windows XP so for anyone not aware,
there are groups specifically for NT/2K/XP related batch discussions. Here
are 2 such groups...
<news:alt.msdos.batch.nt>
<news://news.microsoft.com/microsoft.public.win2000.cmdprompt.admin>
And if you don't have access to those, try...
<http://groups.google.com/groups?as_ugroup=alt.msdos.batch.nt>
Second suggestion, you can get today's date from the %date% variable and
store it in a separate batch to be called the next time the batch runs.
@echo off
if exist lastrun.bat call lastrun.bat
xxcopy c:\download\podcasts\*.mp3 i:\music %lastrun% /SG
for /f "tokens=2" %%A in ("%date:/=-%") do set lastrun=%%A
echo>lastrun.bat (set lastrun=/D:%lastrun%)
Note, this batch code assumes %date% is formatted as
"day mm/dd/yyyy" so you will need to modify if formatted
differently at your location.
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
Jonathan Berry
March 1st 07, 06:43 PM
On Feb 28, 12:55 pm, "Todd Vargo" > wrote:
> "Jonathan Berry" > wrote in message
>
> oups.com...
>
> > Juice, the open source free podcast aggregator, is pretty good. I
> > have two problems with it, and one solution:
>
> > 1. There is no way to temporarily deactivate a source. You have to
> > delete it.
>
> > 2. Juice provides no way to get the podcasts (all stored in separate
> > folders) onto your mp3 device. Here is a batch file that will do it:
>
I might have added that this file should be called
juice.bat
> > ----------snip
> > :: usage: juice 2 21 copies all podcast files newer than Feb 20th to
> > music subdir
>
> > IF "%2"=="" goto file
> > xxcopy c:\download\podcasts\*.mp3 i:\music /D:%1-%2-2007 /SG
>
> > goto end
> > :file
> > echo usage: juice 2 21 copies all podcast files newer than Feb 20th
> > to music subdirectory
> > :end
> > ----------- snip
> > requires xxcopy (free program), assumes that the device is recognized
> > as drive i: and that you want to store the files in folder \music
>
> > assumes that juice stores the podcasts in subdirectories of c:\download
> > \podcasts. The /SG switch 'gathers' the new files in the
> > subdirectories.
> > The /D: switch copies only files not older than the given date, which
> > you have to provide. An improvement would be for the batch file to
> > write today's date to a file and then read it back the next time.
> > Then the user wouldn't have to enter parameters or run it from the
> > command line.
>
> > Some mp3 devices don't do Windows, but mine, a cowon iaudio, does.
>
> > Further suggestions welcome!
>
> First suggestion, you appear to be using Windows XP
Wow, that's scary, I am using Windows XP. I'd long used Win2K, but
the most recent computer had XP on it. What detail gave away that I
was using XP?
> so for anyone not aware,
> there are groups specifically for NT/2K/XP related batch discussions. Here
> are 2 such groups...
> <news:alt.msdos.batch.nt>
> <news://news.microsoft.com/microsoft.public.win2000.cmdprompt.admin>
>
> And if you don't have access to those, try...
> <http://groups.google.com/groups?as_ugroup=alt.msdos.batch.nt>
I found most of those groups (via google groups) and decided to post
to alt.msdos.batch because I believe that the batch file would work
under Win9x and thus would (potentially) be of broader interest than
the .nt groups. Aside from the possibility that Juice doesn't work
under 9x, is there some problem with the xxcopy switches?
> Second suggestion, you can get today's date from the %date% variable and
> store it in a separate batch to be called the next time the batch runs.
>
> @echo off
> if exist lastrun.bat call lastrun.bat
> xxcopy c:\download\podcasts\*.mp3 i:\music %lastrun% /SG
> for /f "tokens=2" %%A in ("%date:/=-%") do set lastrun=%%A
> echo>lastrun.bat (set lastrun=/D:%lastrun%)
Brilliant! Batch-wise, I'm still stuck back in DOS days, knew nothing
about the tokens directive.
So what happens the first time this is run? Is it designed to copy
all files to the mp3 device? Wouldn't it be handy to already have a
file
lastrun.bat before the first run, and what should that look like?
Will this run under Win9x, or is it only WinNT or 2K and up?
Thanks for this suggestion!
>
> Note, this batch code assumes %date% is formatted as
> "day mm/dd/yyyy" so you will need to modify if formatted
> differently at your location.
>
> --
> Todd Vargo
> (Post questions to group only. Remove "z" to email personal messages)
Todd Vargo
March 1st 07, 08:27 PM
Jonathan Berry wrote:
> On Feb 28, 12:55 pm, "Todd Vargo" > wrote:
> > so for anyone not aware,
> > there are groups specifically for NT/2K/XP related batch discussions.
Here
> > are 2 such groups...
> > <news:alt.msdos.batch.nt>
> > <news://news.microsoft.com/microsoft.public.win2000.cmdprompt.admin>
> >
> > And if you don't have access to those, try...
> > <http://groups.google.com/groups?as_ugroup=alt.msdos.batch.nt>
>
> I found most of those groups (via google groups) and decided to post
> to alt.msdos.batch because I believe that the batch file would work
> under Win9x and thus would (potentially) be of broader interest than
> the .nt groups. Aside from the possibility that Juice doesn't work
> under 9x, is there some problem with the xxcopy switches?
That remains a grave assumption made by many since the inception of NT. The
truth is, many of the techniques used in MSDOS/Win9x/Me do not work on
NT/2K/XP systems and likewise. Hence, the reason seperate groups were
created and the reason I included "for anyone not aware".
XXCOPY is not a Microsoft component. Sorry, I did not examine your xxcopy
syntax but if you are having a problem with it, please read it's
documentation.
>
> > Second suggestion, you can get today's date from the %date% variable and
> > store it in a separate batch to be called the next time the batch runs.
> >
> > @echo off
> > if exist lastrun.bat call lastrun.bat
> > xxcopy c:\download\podcasts\*.mp3 i:\music %lastrun% /SG
> > for /f "tokens=2" %%A in ("%date:/=-%") do set lastrun=%%A
> > echo>lastrun.bat (set lastrun=/D:%lastrun%)
>
> Brilliant! Batch-wise, I'm still stuck back in DOS days, knew nothing
> about the tokens directive.
>
> So what happens the first time this is run? Is it designed to copy
> all files to the mp3 device? Wouldn't it be handy to already have a
> file
> lastrun.bat before the first run, and what should that look like?
For someone "still stuck back in DOS days" you seem to have forgotten how ro
REMark a command for testing purposes. ;-)
>
> Will this run under Win9x, or is it only WinNT or 2K and up?
AFAIK, 2K/XP, but feel free to test others.
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
Jonathan Berry
March 1st 07, 09:49 PM
On Mar 1, 12:27 pm, "Todd Vargo" > wrote:
> Jonathan Berry wrote:
> > On Feb 28, 12:55 pm, "Todd Vargo" > wrote:
> > > so for anyone not aware,
> > > there are groups specifically for NT/2K/XP related batch discussions.
> Here
> > > are 2 such groups...
> > > <news:alt.msdos.batch.nt>
> > > <news://news.microsoft.com/microsoft.public.win2000.cmdprompt.admin>
>
> > > And if you don't have access to those, try...
> > > <http://groups.google.com/groups?as_ugroup=alt.msdos.batch.nt>
>
> > I found most of those groups (via google groups) and decided to post
> > to alt.msdos.batch because I believe that the batch file would work
> > under Win9x and thus would (potentially) be of broader interest than
> > the .nt groups. Aside from the possibility that Juice doesn't work
> > under 9x, is there some problem with the xxcopy switches?
>
> That remains a grave assumption made by many since the inception of NT. The
> truth is, many of the techniques used in MSDOS/Win9x/Me do not work on
> NT/2K/XP systems and likewise. Hence, the reason seperate groups were
> created and the reason I included "for anyone not aware".
Aaaah, I see. Just a standard disclaimer.
>
> XXCOPY is not a Microsoft component. Sorry, I did not examine your xxcopy
> syntax but if you are having a problem with it, please read it's
> documentation.
Part of my misunderstanding of your original post. I *thought*
you were implying that my batch file would not work in Win9x,
but you weren't. You were warning us that *your* batch file
might not work in Win9x !
> > > Second suggestion, you can get today's date from the %date% variable and
> > > store it in a separate batch to be called the next time the batch runs.
>
> > > @echo off
> > > if exist lastrun.bat call lastrun.bat
> > > xxcopy c:\download\podcasts\*.mp3 i:\music %lastrun% /SG
> > > for /f "tokens=2" %%A in ("%date:/=-%") do set lastrun=%%A
> > > echo>lastrun.bat (set lastrun=/D:%lastrun%)
>
> > Brilliant! Batch-wise, I'm still stuck back in DOS days, knew nothing
> > about the tokens directive.
>
> For someone "still stuck back in DOS days" you seem to have forgotten how ro
> REMark a command for testing purposes. ;-)
Sorry, I don't understand what you're getting at.
: is the standard begin-delimiter for a label
:: under some version of DOS was discovered to run faster
as a remark begin-delimiter, and I've been using it ever since. It
has always worked. If it doesn't work in some (new) Windows, please
tell me and I'll change.
> > So what happens the first time this is run? Is it designed to copy
> > all files to the mp3 device? Wouldn't it be handy to already have a
> > file
> > lastrun.bat before the first run, and what should that look like?
Can anybody answer any of these questions about Todd's
batch file?
> > Will this run under Win9x, or is it only WinNT or 2K and up?
>
> AFAIK, 2K/XP, but feel free to test others.
>
> --
> Todd Vargo
> (Post questions to group only. Remove "z" to email personal messages)
--
Jonathan Berry
Todd Vargo
March 2nd 07, 04:52 AM
Jonathan Berry wrote:
> On Mar 1, 12:27 pm, "Todd Vargo" > wrote:
> Part of my misunderstanding of your original post. I *thought*
> you were implying that my batch file would not work in Win9x,
> but you weren't. You were warning us that *your* batch file
> might not work in Win9x !
Actually, I was warning that in general *most* NT/2K/XP batch code does not
work in Win9x.
>
> > > > Second suggestion, you can get today's date from the %date% variable
and
> > > > store it in a separate batch to be called the next time the batch
runs.
> >
> > > > @echo off
> > > > if exist lastrun.bat call lastrun.bat
> > > > xxcopy c:\download\podcasts\*.mp3 i:\music %lastrun% /SG
> > > > for /f "tokens=2" %%A in ("%date:/=-%") do set lastrun=%%A
> > > > echo>lastrun.bat (set lastrun=/D:%lastrun%)
> >
> > > Brilliant! Batch-wise, I'm still stuck back in DOS days, knew nothing
> > > about the tokens directive.
> >
> > For someone "still stuck back in DOS days" you seem to have forgotten
how ro
> > REMark a command for testing purposes. ;-)
>
> Sorry, I don't understand what you're getting at.
> : is the standard begin-delimiter for a label
> :: under some version of DOS was discovered to run faster
> as a remark begin-delimiter, and I've been using it ever since. It
> has always worked. If it doesn't work in some (new) Windows, please
> tell me and I'll change.
What I was getting at is; If you REMark the xxcopy line, all the batch will
do is create a lastrun.bat, thus answering your questions below.
>
> > > So what happens the first time this is run? Is it designed to copy
> > > all files to the mp3 device? Wouldn't it be handy to already have a
> > > file
> > > lastrun.bat before the first run, and what should that look like?
>
> Can anybody answer any of these questions about Todd's
> batch file?
HTH
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
vBulletin® v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.