Google Answers Logo
View Question
 
Q: PHP Spider Script ( No Answer,   8 Comments )
Question  
Subject: PHP Spider Script
Category: Computers > Programming
Asked by: neutral-ga
List Price: $10.00
Posted: 21 Jul 2004 22:29 PDT
Expires: 20 Aug 2004 22:29 PDT
Question ID: 377471
I need a php script which will automatically visit the URLs.

The script may have a 'textarea' or it may work with an external .txt
file to retrieve the URLs that it will visit.

The script should allow the user to reset how long the browser will
stay at each site before moving to the next site. (preferably in
second units)

In sum, the user will just launch this .php page in a browser, and the
browser will keep visiting the sites (listed in the 'textarea' or the
external .txt file).

Thanks!
Answer  
There is no answer at this time.

Comments  
Subject: Re: PHP Spider Script
From: any_mouser-ga on 23 Jul 2004 01:32 PDT
 
PHP is not terribly relevant to this....You could easily create this
with a couple frames and some javascript.
Subject: Re: PHP Spider Script
From: neutral-ga on 23 Jul 2004 08:27 PDT
 
If you think you can get it to work with .js with no problems, you are
more than welcome to do so..
Subject: Re: PHP Spider Script
From: cunoodle-ga on 26 Jul 2004 18:29 PDT
 
This could be done with PHP.  So to clear up....you want to physically
SEE these pages as they are coming up or do you just want something
done with the text on from the pages?  Do you want anything else done
with this?  Like do you just want the contents of the pages e-mailed
to you or would you like to for example visit ebay for 60 seconds,
then google for 93 seconds and then yahoo for 380 seconds?  Please
clarify when you have time and I will write the script for you.
Subject: Re: PHP Spider Script
From: neutral-ga on 27 Jul 2004 00:43 PDT
 
No emails or anything similar is necessary.

In addition, the visit time for each page will be the same.

I just want to run the script, and watch it move from page to page
every, shall we say, 30 seconds.

Please do not hesitate to ask if you have other questions in mind.

Thanks.
Subject: Re: PHP Spider Script
From: tely-ga on 04 Aug 2004 03:50 PDT
 
Here it's a javascript example, without input fields validation. So
take care at what you fill in.
If you need something else don't hesitate to ask me.

<html>
	<head>
		<title>For neutral-ga</title>
		<script language="javascript">
			var urls;
			var order = 0;
			var mywin;
			function rotate()
			{
				if( order < urls.length - 1 )
					order++;
				else
					order = 0;
				mywin.location = urls[order];
				setTimeout('rotate();', document.getElementById("time").value*1000);
			}
			
			function init()
			{
				if( document.getElementById("urls").value.length != 0 )
				{
					urls = document.getElementById("urls").value.split(",");
					mywin = window.open(urls[0], '87931', 'width=' +
screen.availWidth + ', height=' + screen.availHeight + ', screenX=0,
left=0, screenY=0, top=0, toolbar=1, scrollbars=1, location=1,
status=1, menubar=1, resizable=1');
					mywin.focus();
					setTimeout('rotate();', document.getElementById("time").value*1000);
				}
				else
				{
					alert("No url's here");
				}
			}
		</script>
	</head>
	<body>
		URL's: <textarea id="urls" name="urls" rows="5"
cols="40"></textarea> (Comma Separated Variable format with full url,
like '://www.google.com/')<br>
		Time: <input type="text" id="time" name="time"> (seconds)<br>
		<input type="button" value="Visit" onclick="init();">
	</body>
</html>

Best regards
Tely
Subject: Re: PHP Spider Script
From: neutral-ga on 04 Aug 2004 04:46 PDT
 
I don't know why I cannot get it to work.

Can you please post a sample textarea content just to make sure that I
am not making a mistake there.

Thanks.
Subject: Re: PHP Spider Script
From: tely-ga on 04 Aug 2004 07:00 PDT
 
The problem it's the google word wrap.

The lines from the above example:

mywin = window.open(urls[0], '87931', 'width=' + screen.availWidth +
', height=' + screen.availHeight + ', screenX=0, left=0, screenY=0,
top=0, toolbar=1, scrollbars=1, location=1,status=1, menubar=1,
resizable=1');

must be one single line of code.

So, copy & paste my example in Notepad, and just make the above lines
of code to be one.
Save as html file and will work.

Best regards
Tely
Subject: Re: PHP Spider Script
From: neutral-ga on 04 Aug 2004 08:18 PDT
 
now works fine.

thanks!

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy