May 1, 2012

[iMacros Script + PHP] imacro + php to the keyword.

imacro + php to the keyword.

 The csv result.csv.

seed keyword,"keyword",&start990,intitle:"keyword",inurl:"keyword",inurl:"keyword" intitle:"keyword"


 


 

 ' ------------------------------------------ Start Script ----------------------------------------
VERSION BUILD=7401110 RECORDER=FX
TAB T=1
SET !ERRORIGNORE YES
SET !ERRORCONTINUE YES
SET !EXTRACT_TEST_POPUP NO
SET !TIMEOUT_TAG 2

'INCLUDE SITE
CMDLINE !DATASOURCE C:\csv\google2.csv
SET !DATASOURCE_COLUMNS 2
SET !LOOP 2
SET !DATASOURCE_LINE {{!LOOP}}
'==============================================================
SET !VAR2 {{!col1}}
TAB T=1
URL GOTO=http://www.google.com/search?hl=en&source=hp&biw=1136&bih=615&q={{!col1}}&aq=f&aqi=g10&aql=&oq=
TAG POS=1 TYPE=DIV ATTR=ID:resultStats&&TXT:About* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL

TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/gg_res2.php ATTR=NAME:keyword CONTENT={{!VAR1}}
SET !VAR1 NULL
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/gg_res2.php ATTR=NAME:submit&&VALUE:submit
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
ADD !VAR2 +{{!EXTRACT}}
SET !EXTRACT NULL
'==============================================================
TAB T=1
URL GOTO=http://www.google.com/search?hl=en&source=hp&biw=1136&bih=615&q={{!col1}}&aq=f&aqi=g10&aql=&oq=&start=990
TAG POS=1 TYPE=I ATTR=TXT:In* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL

TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/gg_res2.php ATTR=NAME:keyword CONTENT={{!VAR1}}
SET !VAR1 NULL
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/gg_res2.php ATTR=NAME:submit&&VALUE:submit
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
ADD !VAR2 +{{!EXTRACT}}
SET !EXTRACT NULL
'===============================================================
TAB T=1
URL GOTO=http://www.google.com/search?hl=en&source=hp&biw=1136&bih=615&q=intitle:{{!col1}}&aq=f&aqi=g10&aql=&oq=
TAG POS=1 TYPE=DIV ATTR=ID:resultStats&&TXT:About* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL

TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/gg_res2.php ATTR=NAME:keyword CONTENT={{!VAR1}}
SET !VAR1 NULL
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/gg_res2.php ATTR=NAME:submit&&VALUE:submit
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
ADD !VAR2 +{{!EXTRACT}}
SET !EXTRACT NULL
'===============================================================
TAB T=1
URL GOTO=http://www.google.com/search?hl=en&source=hp&biw=1136&bih=615&q=inurl:{{!col1}}&aq=f&aqi=g10&aql=&oq=
TAG POS=1 TYPE=DIV ATTR=ID:resultStats&&TXT:About* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL

TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/gg_res2.php ATTR=NAME:keyword CONTENT={{!VAR1}}
SET !VAR1 NULL
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/gg_res2.php ATTR=NAME:submit&&VALUE:submit
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
ADD !VAR2 +{{!EXTRACT}}
SET !EXTRACT NULL
'=================================================================
TAB T=1
URL GOTO=http://www.google.com/search?hl=en&source=hp&biw=1136&bih=615&q=intitle:{{!col1}}+inurl:{{!col1}}&aq=f&aqi=g10&aql=&oq=
TAG POS=1 TYPE=DIV ATTR=ID:resultStats&&TXT:About* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
SET !EXTRACT NULL

TAB T=2
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/gg_res2.php ATTR=NAME:keyword CONTENT={{!VAR1}}
SET !VAR1 NULL
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/gg_res2.php ATTR=NAME:submit&&VALUE:submit
TAG POS=1 TYPE=P ATTR=TXT:* EXTRACT=TXT
ADD !VAR2 +{{!EXTRACT}}
SET !EXTRACT NULL

SET !EXTRACT {{!VAR2}}
SAVEAS TYPE=EXTRACT FOLDER=C:\csv FILE=result2.csv

 ' ------------------------------------------- End Script ----------------------------------------
 php name gg_res2.php.



<html>
<body>
<form method="post" action="<?php echo $PHP_SELF;?>">
keyword : <input type="text" name="keyword" /></br>
<input type="submit" value="submit" name="submit">
</form>
<br/>
<?phpfunction get_string_between($string$start$end){ $string " ".$string; $ini strpos($string,$start); if ($ini == 0) {  return ""; } $ini += strlen($start); $len strpos($string,$end,$ini) - $ini; return substr($string,$ini,$len);
}
function parse_results($result) { $temp get_string_between($result"About "" results"); if($temp == NULL) { $temp get_string_between($result"In order to show you the most relevant results, we have omitted some entries very similar to the "" already"); } $temp str_replace(","""$temp); return $temp;
}// $r = str_replace("\"","",$r);
// $r = str_replace("\\","",$r);
// $q = str_replace(" ", "+", $q);
//start====================$k $_POST["keyword"];
if ($k != ""){$keyword_res1 parse_results($k);
echo "<p>";
echo $keyword_res1;
echo "</p>";
}
else
echo 'no keyword';?>
</body>
</html>


 


How to open it, run it and open the tab 2 imacro gg_res2.php open it.
 Result.csv bad file, then edit with notepad, press ctrl + h to find and replace with: "," Yes.
 I listen, then listen close to open it with excel cell to divide successfully. 

1 comment:

iMacros Script