cougarguard.com — unofficial BYU Cougars / LDS sports, football, basketball forum and message board

cougarguard.com — unofficial BYU Cougars / LDS sports, football, basketball forum and message board (http://www.cougarguard.com/forum/index.php)
-   Religion (http://www.cougarguard.com/forum/forumdisplay.php?f=9)
-   -   LDS Inoculation - Good or Bad? (http://www.cougarguard.com/forum/showthread.php?t=15919)

Jeff Lebowski 01-22-2008 07:44 PM

Quote:

Originally Posted by pelagius (Post 176977)
This is fairly geeky but for those that are technically inclined you might like it. The following is a perl script that will download the dialogue article and convert the article to a pdf.

Code:

#!/usr/bin/perl
 
my $base = "http://content.lib.utah.edu/cgi-bin/getimage.exe?" .
          "CISOROOT=/dialogue&CISOPTR=";
my $size = "&DMWIDTH=1024&DMHEIGHT=1600";
my $beg = 3611;
my $end = 3628;
 
for (my $i=$beg; $i <= $end; ++$i) {
  system(wget,"$base$i\&DMWIDTH=1024&DMHEIGHT=1600");
  system(convert,"getimage.exe?CISOROOT=%2Fdialogue&CISOPTR=$i$size",
        "foo$i.gif");
  system(rm,"getimage.exe?CISOROOT=%2Fdialogue&CISOPTR=$i$size");
}
 
system(convert,"foo*.gif","foo.pdf");
for (my $i=$beg; $i <= $end; ++$i) {
  system(rm,"foo$i.gif");
}

It should work on most Unix systems. I think it will work on a OS X, but not 100% sure. I wrote it on my linux box.

Awesome.

pelagius 01-22-2008 07:51 PM

Quote:

Originally Posted by Jeff Lebowski (Post 176995)
Awesome.

Jeff you can download any article and convert it to a pdf by just changing the following:

my $beg = 3611;
my $end = 3628;

Which are the beginning and ending page numbers and are listed in the URL for each page. They pdf is fairly large because it is just concatinating the images of each page but it is much more readable than the website and it prints out nicely. It does need the "convert" and "wget" commands to work since it calls both.

Archaea 01-22-2008 09:05 PM

Quote:

Originally Posted by pelagius (Post 176997)
Jeff you can download any article and convert it to a pdf by just changing the following:

my $beg = 3611;
my $end = 3628;

Which are the beginning and ending page numbers and are listed in the URL for each page. They pdf is fairly large because it is just concatinating the images of each page but it is much more readable than the website and it prints out nicely. It does need the "convert" and "wget" commands to work since it calls both.

How about something working on a Windows system XP or higher?

Concatenating, I like that word. Isn't it spelled with an "e" though?

Tex 01-22-2008 09:22 PM

Quote:

Originally Posted by Archaea (Post 177031)
How about something working on a Windows system XP or higher?

Concatenating, I like that word. Isn't it spelled with an "e" though?

The code he posted will work on a Windows XP system as long as you have a Perl interpreter installed. ActiveState (www.activestate.com) provides one.

pelagius 01-22-2008 09:33 PM

Quote:

Originally Posted by Archaea (Post 177031)
Concatenating, I like that word. Isn't it spelled with an "e" though?

I'm just happy I was only off by an "e"

pelagius 01-22-2008 09:40 PM

Quote:

Originally Posted by Tex (Post 177039)
The code he posted will work on a Windows XP system as long as you have a Perl interpreter installed. ActiveState (www.activestate.com) provides one.

You are right. You would also have install "wget" and "convert" which I imagine are available for Windows but have never checked (I am rarely on a non-Unix system). The Perl code just calls those programs and they do most of the work (although no doubt you can see that from the code itself).

Archaea 01-22-2008 10:15 PM

That looks like a lot of downloads, but I'll give it a try.

pelagius 01-22-2008 10:26 PM

Quote:

Originally Posted by Archaea (Post 177057)
That looks like a lot of downloads, but I'll give it a try.

Yep, its not the most user-friendly thing. Of course, I am always happy to make you a pdf.


All times are GMT. The time now is 07:29 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.