Re: Automating programs

From: wd10 (nospam_at_nospam.invalid)
Date: 11/14/05


Date: Mon, 14 Nov 2005 00:44:22 -1000

On Mon, 26 Sep 2005 20:26:29 +0000, Robert Newson wrote:

> wd10 wrote:
>
>> What is the best way to automate programs in Linux?
>>
>> I use Lynx to extract text from web sites and save to a file and then I
>> want to rename the output files and do things for them. I know there must
>> be a way to avoid all the typing.
>>
>> Is is possible to automate programs, for example:
>> * start Firefox
>> * go to my web page
>> * save my web page, or take a screenshot
>
> $ man wget
> wget(1) wget(1)
>
> NAME
> wget - a utility to retrieve files from the World Wide Web
>
> SYNOPSIS
> wget [options] [URL-list]
> ...
> DESCRIPTION
> Wget is a utility designed for retrieving binary documents
> across the Web, through the use of HTTP (Hyper Text Trans­-
> fer Protocol) and FTP (File Transfer Protocol), and saving
> them to disk. Wget is non-interactive, which means it can
> work in the background, while the user is not logged in,
> unlike most of web browsers (thus you may start the pro­-
> gram and log off, letting it do its work). Analysing
> server responses, it distinguishes between correctly and
> incorrectly retrieved documents...
>
>
> Try using wget to download the web page(s) you are interested in. Further
> processing programs would depend upon what you want to do with the web page(s).
>
>
>> * save file and maybe manipulate it, shrink, output as jpg, or whatever --
>> append to HTML file and FTP it to a remote server?
>>
>> The previous example is just a random idea... the
>> purpose is to learn how to automate my programs.
>>
>> What should I learn to do this? Should I figure out how to do it in Perl,
>> or is there another way?
>>
>> Thanks
>>

I'm actually looking for a way to automate my programs. I've used wget
and like it. I also figured out this today which works better for me than
wget because often all I want is the text and not any HTML:

lynx -crawl -traverse "http://mysite.com" >myfile.txt

But that saves in .dat files and I want them to be in .txt files so I can
use them on my Windows partition if necessary (probably not necessary, but
I want to learn how to do it anyway).

So another example of an automated task I would like to be able to do
is:

run the following command:
lynx -crawl -traverse "$my-command-line-URL-argument" (but somehow send
this into a specific directory with the same name as the URL)

then:
switch to this directory:
~/$my-command-line-URL-argument

then something like this:
rename 's/*\.dat/$HTML-page-title\.txt/' *.dat

And maybe process it some more. I just don't know how to string it all
together... I'm not sure what I am looking for. I've been using Linux for
a while but not the advanced side of it yet.

There must also be a way to automatically control programs like Firefox,
take screenshots, manipulate images, etc.



Relevant Pages

  • Re: Automated Production of Web Pages
    ... I simply first call a preamble HTML file, ... The CSV database contains the changing data, and the awk script ... automate this process? ...
    (freebsd-questions)
  • Re: Automating keytab creation when using windows 2003 KDC and linux clients
    ... the only way to automate it is via the ldap interface to Active Directory ... I used linux systems to understand interoperability ... The steps what I have followed to make these linux machines ...
    (comp.protocols.kerberos)
  • HTML Printing Options
    ... Each row is used to create the HTML file and also defines its ... The HTML file is delivered/printed, etc. to the destination specified in ... Automate Microsoft Word. ... Through Word automation, I can specify the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Backing Up Linux Volumes
    ... Subject: Backing Up Linux Volumes ... automate your z/OS, z/VM and LINUX full volume backups under ... Innovation's FDR/UPSTREAM is a possible backup product for your Linux ...
    (bit.listserv.ibm-main)
  • Re: Windows and Linux
    ... I need to code some libraries for win and linux os and hope make or ... somethink can help me to automate my build process. ...
    (comp.lang.c)