I gang

Fix SERP checking php script

I have a php script that checks google SERP's, stores them in a database, and they gives me a report.

The problem is, that when google updated its results page a couple months ago, my script stopped working.

I need someone to fix the script so it can pick up the desired string on the search results page.

I believe this is only a couple lines of code that will need to analyzed and fixed.

The code below is most likely to be where the problem exists.

global $TIME;

$TIME=time();

global $keywordsfile;

$result = mysql_query("select keyword from keyword where domain = '$getdomain'");

if (!$result) {

die('Invalid query: ' . mysql_error());

}

$keywordnum = 0; // NUmber of keywords increased in while

while ($keywords = mysql_fetch_row($result))

{

global $sleeptime;

$sleeptime=5;

ini_set('user_agent', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR [url removed, login to view]; .NET CLR [url removed, login to view]; InfoPath.1)');

$keywords_count=sizeof($keywords);

// GET SERPS

foreach ($keywords as $line_num => $keyword)

{

if ($http_requests)

{

$keyword=chop($keyword);

$keywordnum = $keywordnum + 1;

echo ($keywordnum).': '.$keyword.' ...';

for ($x=1; $x<=$max_serps; $x++)

{

// [url removed, login to view]

/////////////

echo "... [url removed, login to view]<br/>";

$url='[url removed, login to view]'.urlencode($keyword).'&hl=en&safe=off&start='.($x-1)*10 .'&sa=N&num='.$serp_listings;

//echo $url."\n";

$data=sanitize_input(file_get_contents($url));

mysql_query("INSERT INTO $mysql_table (domain, keyword, engine, page, data, time) VALUES ('$getdomain','$keyword','[url removed, login to view]','$x', '$data','$TIME')");

$setpage = $x;

/*

// Yahoo

echo "... [url removed, login to view]";

$url='[url removed, login to view]' .urlencode($keyword). '&ei=UTF-8&fr=sfp&n='.$serp_listings.'&b='. ((($x-1) * 10) + 1);

//echo $url."\n";

$data=sanitize_input(file_get_contents($url));

mysql_query("INSERT INTO $mysql_table (domain, keyword, engine, page, data, time) VALUES ('$getdomain'. '$keyword','yahoo','$x','$data','$TIME')");

*/

// Time delayed

$time_delayed="0";

while($time_delayed < $sleeptime)

{

if (!$time_delayed)

{echo "\n";}

else

{echo "\r";}

echo "\t".'Pausing: '.sec2hms($sleeptime - $time_delayed).' secs. Runtime: '.sec2hms(time() - $TIME).'. Est. Remaining: '.sec2hms(($sleeptime * ($keywords_count - $line_num - 1)) + ($sleeptime - $time_delayed)).' ('.($keywords_count - $line_num - 1).' keywords left).';

sleep(1);

$time_delayed++;

}

}

}

echo "\n<br />";

}

// PARSE SERPS

foreach ($keywords as $line_num => $keyword)

{

$keyword=chop($keyword);

echo ($line_num + 1).': '.$keyword.' ...'."\n";

// Parse [url removed, login to view]

$COUNT=0;

$TRACKED_G="-";

for ($x=1; $x<=$max_serps; $x++)

{

$QUERY="SELECT data FROM $mysql_table WHERE keyword='$keyword' AND engine='[url removed, login to view]' AND page='$x'";

$RESULT = mysql_query($QUERY);

while($row = mysql_fetch_array($RESULT))

{

//echo $row[0];

$data=split("<h3 ", $row[0]);

foreach ($data as $line)

{

if (ereg("class=r><a href=\"(http|https|ftp)://([^/]+)",$line,$regs))

{

$COUNT++;

if (strstr($regs[2], $domain) && $TRACKED_G=="-")

{

$TRACKED_G=$COUNT;

}

}

}

}

}

Færdigheder: MySQL, PHP

Se mere: php serp, serps script working, php script serp google, serp php code, serp checking script, serps php script, string problem, string b, net fix com, my fix com, infopath report, global p, get my fix, ftp yahoo.com, ftp engine, foreach in php and mysql, c sizeof string, php serp keyword script, php code query google serp, google serp script, php code serp, php serp code, serp script php, google serp php script, serp script

Om arbejdsgiveren:
( 22 bedømmelser ) Colorado Springs, United States

Projekt-ID: #970355

Tildelt til:

phpseo

i am expert in creating search engine scraping. have done several google bing yahoo scraping projects. Examples in PMB

$30 USD in 2 dage
(28 bedømmelser)
5.4

6 freelancers are bidding on average $38 for this job

SigmaVisual

We can help in your project, please check PMB and our ratings/reviews to get idea of our experience.

$50 USD på 1 dag
(224 bedømmelser)
7.7
srinichal

Ready to fix and deliver the script

$40 USD in 2 dage
(80 bedømmelser)
6.9
arnab0143

--Hello Sir, Please check your pm. Thanks.--

$30 USD in 0 dage
(67 bedømmelser)
6.6
DrTech76

Hi! Do you mind looking the questions I've sent you? Thanks.

$30 USD in 0 dage
(240 bedømmelser)
6.5
dagdya99

Lets start

$50 USD på 1 dag
(92 bedømmelser)
6.5
Bindukka

Dear Hiring Manager, I'm interested in your job post involving these skills. I have experiences in coding especially in php and sql . I believe my skills would be suitable for your project. I am available to chat by Mere

$30 USD in 2 dage
(0 bedømmelser)
0.0