Page 1 of 2
Add bulk domain name to google search URL
Posted: Fri Aug 06, 2004 6:48 pm
by AcornDomains.co.uk
Hi everyone,
I am a PHP novice but would like to write a script to do the following:
1. text box where I can paste a list of domain names, 1 name per line
2. add each domain name in the list to a Google search string
example:
domain line 1
http://www.google.com/search?q=acorndomains.co.uk
domain line 2
http://www.google.com/search?q=pcpets.co.uk
after the search I get a list of the names and how many times they appear in Google
Can anyone help me please?
I have hunted high and low for a script that already does this without success
Many thanks, nice forum!
Posted: Fri Aug 06, 2004 6:54 pm
by Joe
Hmm I think this would involve more than just PHP.
Posted: Fri Aug 06, 2004 7:24 pm
by AcornDomains.co.uk
This site does something similar using a PHP file but perhaps there is more under the covers.
Does it help?
http://www.startname.com/linkpop/index.php
I can use Delphi a little also but would prefer a web script based solution rather than an application
Posted: Fri Aug 06, 2004 7:33 pm
by Joe
I think you would require
curl for that. I am not 100% sure.
Posted: Fri Aug 06, 2004 7:46 pm
by AcornDomains.co.uk
Joe,
Someone did mention that to me, I will have to check it out
Thanks for replying anyway.
Anyone else got a quick fix for me?
Posted: Fri Aug 06, 2004 7:47 pm
by Joe
no problem, and sorry that is about the best answer I can give as an individual!
Posted: Fri Aug 06, 2004 7:47 pm
by feyd
if you have file url wrappers on, you could use [php_man]file_get_contents[/php_man]() and some regular expressions to pull the numbers out...
Posted: Fri Aug 06, 2004 7:48 pm
by Joe
Thats actually a great idea feyd, I might just try that out myself

Posted: Fri Aug 06, 2004 8:00 pm
by AcornDomains.co.uk
Sorry means nothing to me, as I said I am a novice.
Would you mind giving me some sample code to get me started?
Many thanks for your input
Posted: Fri Aug 06, 2004 8:07 pm
by Joe
Well to make it easier have a look at
file_get_contents
and
preg_match_all.
Seen as you are a newcomer these would be best for your project. Getting us to write your code is an educative lesson lost for yourself.
Posted: Fri Aug 06, 2004 8:15 pm
by AcornDomains.co.uk
Joe,
I am not trying to just get you to do the all work - I am keen to learn just wanted a head start thats all. At this point I find it easier to read back code and understand it than to write it in the first place.
The functions you posted I think are what I need to use to read the search page results, correct?
How do I get a text box (to paste the Domains into) and state the URL to pass each domain onto the end of, this is the starting point.
Many thanks for your persistance
Posted: Fri Aug 06, 2004 8:18 pm
by Joe
Well your now asking how to make a textbox which makes me think you should be learning more html rather than php.
Code: Select all
<textarea cols="10" rows="4" name="domain"></textarea>
The above html gives you a textarea. Then you are required to make a backend php script which uses $_POST[] to obtain the variable values from the previous page.
Posted: Fri Aug 06, 2004 8:22 pm
by AcornDomains.co.uk
I have written plenty in HTML I just dont know how to use it with PHP
Posted: Fri Aug 06, 2004 8:26 pm
by Joe
well say the textarea had the name "domain" like the example given above, then the backend would retrieve this using:
try this out:
Code: Select all
<?php
$var = $_POSTї'domain'];
print($var);
?>
Remember the form must use the "post" action
Posted: Fri Aug 06, 2004 8:29 pm
by Joe
Also, go
here and learn the basics of php.
