Forum Moderators: coopster & phranque

Message Too Old, No Replies

Search Engine Position Checker

How dat work?

         

rycrostud

3:11 pm on Jan 31, 2002 (gmt 0)

10+ Year Member



There's definitely no simple, one-line answer to this one, but any hints or suggestions would be v cool.

I would like to write my own set of PHP scripts that would enable me to check the position of a given URL in a search engine based on some keywords. You know the kinda thing. There's quite a few about, like on JimTools.

I just don't understand the theory behind it, or infact what the theory is, come to mention it!

I'm having difficulty finding any info on this.

Any idea where I might start or some search terms to look for or perhaps some PHP tutes?

sugarkane

4:54 pm on Jan 31, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is actually a lot simpler than you might think... if you've got a handle on regular expressions ;)

In it's simplest form:

- Analyse the URL of a SERP to decipher what format the query is passed to the engine, plus any other parameters (results per page, starting point etc)
- Construct a valid URL using your own search terms
- Collect the SERP using something like fopen() - I'm not 100% on which function, as I do this kind of thing in Perl (LWP) rather than PHP
- Parse the page you've collected, using regular expressions to find URLs in the SERP
- Check if the URL you're looking for matches up

That, in a nutshell, is it. The tricky part is in constructing a regex to parse out the URLs - this can get quite complicated eg my one for AV is something like

@<a.*?rn true;">(.*?)</a>(.*?)<span class=x>\s*?URL: (.*?)\s*?&#@gi

rycrostud

2:51 pm on Feb 1, 2002 (gmt 0)

10+ Year Member



Thanks geeza. That was kinda what I was thinking, but I would've probably done it a really daft way.

I'll have a play.

KodeKrash

11:07 pm on Feb 7, 2002 (gmt 0)

10+ Year Member



Sugarkane has a perfectly good answer, and I have an alternate answer:
RegExp are not always needed. Fuzzy logic can handle it without using RegExp methods. But then, Fuzzy logic is more complex to understand and write than are RegExp.

rycrostud

8:47 am on Feb 8, 2002 (gmt 0)

10+ Year Member



Fuzzy logic is a new one on me. Do you know of any good PHP tutorial sites that cover this topic?

KodeKrash

5:16 pm on Feb 8, 2002 (gmt 0)

10+ Year Member



I don't know of any language specific tutorials on fuzzy logic, and not many sites that deal with it in general either. Just do some RTFM on artificial intelligence - it will get you in the right direction. AI is one step farther than fuzzy logic, which is one step farther than programatic logic.

rycrostud

8:50 am on Feb 11, 2002 (gmt 0)

10+ Year Member



Now I'm scared. :(

Tapolyai

2:21 am on Feb 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Don't worry about it! sugarkane gave you the exact answer...

Grab the page with the right URL, strip the code, find your URL.

Fuzzy logic sounds awesome except it's like hunting a pigeon with a 12 gauge shotgun at 12 inches... Ever seen what that does to the pigeon?

KodeKrash

2:47 am on Feb 13, 2002 (gmt 0)

10+ Year Member



How about a dove with a 10 gauge at about 20 ft? About the same. :o)