Add bulk domain name to google search URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

AcornDomains.co.uk
Forum Newbie
Posts: 8
Joined: Fri Aug 06, 2004 6:48 pm

Add bulk domain name to google search URL

Post 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!
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Hmm I think this would involve more than just PHP.
AcornDomains.co.uk
Forum Newbie
Posts: 8
Joined: Fri Aug 06, 2004 6:48 pm

Post 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
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

I think you would require curl for that. I am not 100% sure.
AcornDomains.co.uk
Forum Newbie
Posts: 8
Joined: Fri Aug 06, 2004 6:48 pm

Post 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?
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

no problem, and sorry that is about the best answer I can give as an individual!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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...
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Thats actually a great idea feyd, I might just try that out myself :D
AcornDomains.co.uk
Forum Newbie
Posts: 8
Joined: Fri Aug 06, 2004 6:48 pm

Post 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
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post 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.
AcornDomains.co.uk
Forum Newbie
Posts: 8
Joined: Fri Aug 06, 2004 6:48 pm

Post 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
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post 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.
AcornDomains.co.uk
Forum Newbie
Posts: 8
Joined: Fri Aug 06, 2004 6:48 pm

Post by AcornDomains.co.uk »

I have written plenty in HTML I just dont know how to use it with PHP
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

well say the textarea had the name "domain" like the example given above, then the backend would retrieve this using:

Code: Select all

$_POST&#1111;'domain'];
try this out:

Code: Select all

<?php
$var = $_POST&#1111;'domain'];
print($var);
?>
Remember the form must use the "post" action
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Also, go here and learn the basics of php. :D
Post Reply