Sponsored Content
Top Forums Shell Programming and Scripting Script to run php script on multiple website domains Post 302516984 by DGPickett on Monday 25th of April 2011 04:45:01 PM
Old 04-25-2011
Well, wget is simpler than lynx, but it sounds like simple scripting:
Code:
for dom in dom1 dom2 dom3 dom4
do
 lynx -dump $dom/phpfile.php >output.$dom
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Getting one script to run on multiple boxes

I have a script that generates an output file after pulling data from a local DB on one of my boxes. There are other nearly-identical boxes on the network, each with their own local DB, and I'd like to run the script there too. Copying the script to each box and then running them individually... (11 Replies)
Discussion started by: bschnair
11 Replies

2. Shell Programming and Scripting

Enabling a script to run in multiple paths

I have a script that i need to run from different paths. for example mypc/path1/path2/, mypc/path1/path2/path3/, and mypc/path1/path2/path3/path4 How do i set up that script so that it can execute in any of the above paths or how can i make it run on any path on my computer?? (5 Replies)
Discussion started by: dowell
5 Replies

3. UNIX for Dummies Questions & Answers

Shell Script to Auto Run PHP Script

Hello All! I am looking to build a monitoring script. The script should always run as a system service of some type and should always check that a PHP script is running. Maybe there is a way to assign a PHP script to a certain PID so that the monitor script that check for the PID in top... (4 Replies)
Discussion started by: elDeuce
4 Replies

4. UNIX for Dummies Questions & Answers

Sh script to run multiple php scripts

I wrote a .sh script to run 5 php scripts. The problem is that it's running 1 then 2 then 3 in that order .... I want it to execute all 5 at ONCE.... nohup php /home/script1/script1.php && nohup php /home/script2/script2.php && nohup php /home/script3/script3.php && nohup php... (1 Reply)
Discussion started by: holyearth
1 Replies

5. Shell Programming and Scripting

Need a script to run on multiple mail servers..

Hello, I am a Unix newbie and I need a script in which I can run a command on multiple servers at work. The command is to start a storage process and I am sick of doing it manually on all servers.. Here's the command: /opt/bss/bin/snmptable -CB -v2c -c P67LzuBm hostname hrStorageTable... (4 Replies)
Discussion started by: kinyyy
4 Replies

6. Programming

Need a tracking PHP Script – “how long people stay on the website?”

I want to know, is there a way to track how long anyone has been logged into website and then insert it up for each time they have logged on. In case, user a logs in for 30 minutes, then later comes back and logs in for an hour, then later comes back and logs in for 50 minutes, Add... (1 Reply)
Discussion started by: AimyThomas
1 Replies

7. Shell Programming and Scripting

Run script on multiple files

I have a script that I need to run on one file at a time. Unfortunately using for i in F* or cat F* is not possible. When I run the script using that, it jumbles the files and they are out of order. Here is the script: gawk '{count++; keyword = $1} END { for (k in count) {if (count == 2)... (18 Replies)
Discussion started by: newbie2010
18 Replies

8. Shell Programming and Scripting

Run a script on multiple servers

I need to run a script on a bunch of remote servers. how can this be done without ssh into each individual server and run it its under /sbin/script.sh on each server (1 Reply)
Discussion started by: tdubb123
1 Replies

9. UNIX for Dummies Questions & Answers

Run script on multiple files

Hi Guys, I've been having a look around to try and understand how i can do the below however havent come across anything that will work. Basically I have a parser script that I need to run across all files in a certain directory, I can do this one my by one on comand line however I... (1 Reply)
Discussion started by: mutley2202
1 Replies

10. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
Mojo::DOM(3pm)						User Contributed Perl Documentation					    Mojo::DOM(3pm)

NAME
Mojo::DOM - Minimalistic HTML5/XML DOM parser with CSS3 selectors SYNOPSIS
use Mojo::DOM; # Parse my $dom = Mojo::DOM->new('<div><p id="a">A</p><p id="b">B</p></div>'); # Find my $b = $dom->at('#b'); say $b->text; # Walk say $dom->div->p->[0]->text; say $dom->div->children('p')->first->{id}; # Iterate $dom->find('p[id]')->each(sub { say shift->{id} }); # Loop for my $e ($dom->find('p[id]')->each) { say $e->text; } # Modify $dom->div->p->[1]->append('<p id="c">C</p>'); # Render say $dom; DESCRIPTION
Mojo::DOM is a minimalistic and relaxed HTML5/XML DOM parser with CSS3 selector support. It will even try to interpret broken XML, so you should not use it for validation. CASE SENSITIVITY
Mojo::DOM defaults to HTML5 semantics, that means all tags and attributes are lowercased and selectors need to be lowercase as well. my $dom = Mojo::DOM->new('<P ID="greeting">Hi!</P>'); say $dom->at('p')->text; say $dom->p->{id}; If XML processing instructions are found, the parser will automatically switch into XML mode and everything becomes case sensitive. my $dom = Mojo::DOM->new('<?xml version="1.0"?><P ID="greeting">Hi!</P>'); say $dom->at('P')->text; say $dom->P->{ID}; XML detection can also be disabled with the "xml" method. # Force XML semantics $dom->xml(1); # Force HTML5 semantics $dom->xml(0); METHODS
Mojo::DOM implements the following methods. "new" my $dom = Mojo::DOM->new; my $dom = Mojo::DOM->new('<foo bar="baz">test</foo>'); Construct a new Mojo::DOM object. "all_text" my $trimmed = $dom->all_text; my $untrimmed = $dom->all_text(0); Extract all text content from DOM structure, smart whitespace trimming is enabled by default. # "foo bar baz" $dom->parse("<div>foo <p>bar</p>baz </div>")->div->all_text; # "foo barbaz " $dom->parse("<div>foo <p>bar</p>baz </div>")->div->all_text(0); "append" $dom = $dom->append('<p>Hi!</p>'); Append to element. # "<div><h1>A</h1><h2>B</h2></div>" $dom->parse('<div><h1>A</h1></div>')->at('h1')->append('<h2>B</h2>'); "append_content" $dom = $dom->append_content('<p>Hi!</p>'); Append to element content. # "<div><h1>AB</h1></div>" $dom->parse('<div><h1>A</h1></div>')->at('h1')->append_content('B'); "at" my $result = $dom->at('html title'); Find a single element with CSS3 selectors. All selectors from Mojo::DOM::CSS are supported. # Find first element with "svg" namespace definition my $namespace = $dom->at('[xmlns:svg]')->{'xmlns:svg'}; "attrs" my $attrs = $dom->attrs; my $foo = $dom->attrs('foo'); $dom = $dom->attrs({foo => 'bar'}); $dom = $dom->attrs(foo => 'bar'); Element attributes. "charset" my $charset = $dom->charset; $dom = $dom->charset('UTF-8'); Alias for "charset" in Mojo::DOM::HTML. "children" my $collection = $dom->children; my $collection = $dom->children('div'); Return a Mojo::Collection object containing the children of this element, similar to "find". # Show type of random child element say $dom->children->shuffle->first->type; "content_xml" my $xml = $dom->content_xml; Render content of this element to XML. # "<b>test</b>" $dom->parse('<div><b>test</b></div>')->div->content_xml; "find" my $collection = $dom->find('html title'); Find elements with CSS3 selectors and return a Mojo::Collection object. All selectors from Mojo::DOM::CSS are supported. # Find a specific element and extract information my $id = $dom->find('div')->[23]{id}; # Extract information from multiple elements my @headers = $dom->find('h1, h2, h3')->map(sub { shift->text })->each; "namespace" my $namespace = $dom->namespace; Find element namespace. # Find namespace for an element with namespace prefix my $namespace = $dom->at('svg > svg:circle')->namespace; # Find namespace for an element that may or may not have a namespace prefix my $namespace = $dom->at('svg > circle')->namespace; "parent" my $parent = $dom->parent; Parent of element. "parse" $dom = $dom->parse('<foo bar="baz">test</foo>'); Alias for "parse" in Mojo::DOM::HTML. # Parse UTF-8 encoded XML my $dom = Mojo::DOM->new->charset('UTF-8')->xml(1)->parse($xml); "prepend" $dom = $dom->prepend('<p>Hi!</p>'); Prepend to element. # "<div><h1>A</h1><h2>B</h2></div>" $dom->parse('<div><h2>B</h2></div>')->at('h2')->prepend('<h1>A</h1>'); "prepend_content" $dom = $dom->prepend_content('<p>Hi!</p>'); Prepend to element content. # "<div><h2>AB</h2></div>" $dom->parse('<div><h2>B</h2></div>')->at('h2')->prepend_content('A'); "replace" $dom = $dom->replace('<div>test</div>'); Replace elements. # "<div><h2>B</h2></div>" $dom->parse('<div><h1>A</h1></div>')->at('h1')->replace('<h2>B</h2>'); "replace_content" $dom = $dom->replace_content('test'); Replace element content. # "<div><h1>B</h1></div>" $dom->parse('<div><h1>A</h1></div>')->at('h1')->replace_content('B'); "root" my $root = $dom->root; Find root node. "text" my $trimmed = $dom->text; my $untrimmed = $dom->text(0); Extract text content from element only (not including child elements), smart whitespace trimming is enabled by default. # "foo baz" $dom->parse("<div>foo <p>bar</p>baz </div>")->div->text; # "foo baz " $dom->parse("<div>foo <p>bar</p>baz </div>")->div->text(0); "text_after" my $trimmed = $dom->text_after; my $untrimmed = $dom->text_after(0); Extract text content immediately following element, smart whitespace trimming is enabled by default. # "baz" $dom->parse("<div>foo <p>bar</p>baz </div>")->div->p->text_after; # "baz " $dom->parse("<div>foo <p>bar</p>baz </div>")->div->p->text_after(0); "text_before" my $trimmed = $dom->text_before; my $untrimmed = $dom->text_before(0); Extract text content immediately preceding element, smart whitespace trimming is enabled by default. # "foo" $dom->parse("<div>foo <p>bar</p>baz </div>")->div->p->text_before; # "foo " $dom->parse("<div>foo <p>bar</p>baz </div>")->div->p->text_before(0); "to_xml" my $xml = $dom->to_xml; Render this element and its content to XML. # "<div><b>test</b></div>" $dom->parse('<div><b>test</b></div>')->div->to_xml; "tree" my $tree = $dom->tree; $dom = $dom->tree(['root', [qw(text lalala)]]); Alias for "tree" in Mojo::DOM::HTML. "type" my $type = $dom->type; $dom = $dom->type('div'); Element type. # List types of child elements $dom->children->each(sub { say $_->type }); "xml" my $xml = $dom->xml; $dom = $dom->xml(1); Alias for "xml" in Mojo::DOM::HTML. CHILD ELEMENTS
In addition to the methods above, many child elements are also automatically available as object methods, which return a Mojo::DOM or Mojo::Collection object, depending on number of children. say $dom->p->text; say $dom->div->[23]->text; $dom->div->each(sub { say $_->text }); ELEMENT ATTRIBUTES
Direct hash reference access to element attributes is also possible. say $dom->{foo}; say $dom->div->{id}; SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>. perl v5.14.2 2012-09-05 Mojo::DOM(3pm)
All times are GMT -4. The time now is 01:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy