Click to See Complete Forum and Search --> : Contextual ads coding.


kennyTE
08-19-2007, 01:16 PM
Hi,
I'm study in a university, and my lecturer ask me to do some coding and some case study on how google or adbrite contextual ads function. And i need to do a small project similar to this advertising agencies.

As i know, contextual ads is target according to the content that in the page, lets say, it will crawl in to our content, and find the nearest text in the content and fetch the ads that similar to the page on user browsing.

I have no idea how to code it. Can anyone give me how its works? how they crawl the content and match with the contextual ads?

Please guide me.

Regards.
Kenny

MrCoder
08-20-2007, 04:04 AM
Normally the ad's will match on selected keyword scoring.


$data = file_get_contents("www.mysite.com/index.html");

if(strstr($data, "keyword"))
{
// display add...
}


That is very basic, would need a lot of work to score a site vs keywords.

kennyTE
08-21-2007, 02:11 AM
Thanks for your reply,

as i try your code, let say i get content form this forum and find the words - "keyword", it do find it? but, how to match the most keywords in this page? Which mean, we must find the main keywords in this page. is this the way google do it in adsense?

<?php
$data = file_get_contents("http://www.webdeveloper.com/forum/showthread.php?t=158549");

if(strstr($data, "keyword"))
{
// display add...
echo "key words found";
}
?>

the above code works great, but seems that the load time is so so slow, it get the content form the site and match it, the process takes much time.