ThaiSEOBoard.com

พัฒนาเว็บไซต์ => Programming => ข้อความที่เริ่มโดย: Nopzixcros ที่ 26 ตุลาคม 2012, 21:32:06



หัวข้อ: สอบถามเรื่อง imacro js หน่อยครับ ช่วยผมตรวจโค้ดหน่อยครับ +1
เริ่มหัวข้อโดย: Nopzixcros ที่ 26 ตุลาคม 2012, 21:32:06
ผมลองรันมันขึ้น

SyntaxError: missing ; before statement (Error code: 991)

แบบนี้อะครับ
ขอบคุณนะครับ

โค๊ด:
var loop =1;
var domain = "xxx.com";
var username = "xxxx";
var password = "xxxx";
var trackingid = "xxx-20";
var accesskey = "xxxx";
var secretkey = "xxxxx";
var crLF = "\n";
var reg = /\s+/g;
template_header = "VERSION BUILD=7631211 RECORDER=FX"+ crLF;
template_header += "SET !ERRORIGNORE YES"+ crLF;
template_header += "SET !ERRORCONTINUE YES"+ crLF;
template_header += "SET !EXTRACT_TEST_POPUP NO"+ crLF;
template_header += "'SET !TIMEOUT_TAG 10"+ crLF;
template_header += "'SET !TIMEOUT 10"+ crLF;

for(i=2;i<=loop;i++){
macro = "CODE:"+ template_header + crLF;
macro += "SET !DATASOURCE ccc.csv" + crLF;
macro += "SET !DATASOURCE_COLUMNS 2"+ crLF;
macro += "SET !LOOP "+ i + crLF;
macro += "SET !DATASOURCE_LINE {{!LOOP}}"+ crLF;
macro += "SET !EXTRACT {{!COL1}}"+ crLF;
iimPlay(macro);

keyword=iimGetLastExtract(0);
    getkeyword=keyword.replace(reg,"");
keyspace=keyword.replace(reg,"<SP>");
macro += "SET !EXTRACT {{!COL2}}"+ crLF;
iimPlay(macro);
asincall=iimGetLastExtract(0);
   
macro = "CODE:"+ template_header + crLF;
macro += "TAB T=1"+ crLF;

macro += "URL GOTO=http://www.xxxx.com/?asin=" + asincall + "&accesskey=" + accesskey + "&secretkey=" + secretkey + "&tagid=" + trackingid + "&user=" + username + "&pass=" + password + "&keyword="+ keyspace +  crLF;
macro += "WAIT SECONDS=1"+ crLF;
macro += "TAG POS="1" TYPE=DIV ATTR=ID:name&&TXT:* EXTRACT=TXT"+ crLF;

iimPlay(macro);
   
    titlepost = iimGetLastExtract(0);
   
macro += "TAB OPEN"+ crLF;
macro += "TAB T=2"+ crLF;
macro += "URL GOTO=http://{{getkeyword}}.{{domain}}/wp-admin/options-general.php"+ crLF;
macro += "TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:options.php ATTR=ID:blogname CONTENT=" + titlepost + crLF;
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:options.php ATTR=ID:submit" + crLF;
macro += "WAIT SECONDS=1"+ crLF;

macro += "TAB CLOSE"+ crLF;
macro += "TAB T=1"+ crLF;

macro += "URL GOTO=http://www.xxxx.com/?asin=" + asincall + "&user=" + username + "&pass=" + password + "&keyword="+ keyspace +  crLF;
macro += "WAIT SECONDS=1"+ crLF;
macro += "TAG POS="1" TYPE=DIV ATTR=ID:name&&TXT:* EXTRACT=TXT"+ crLF;

   
    description = iimGetLastExtract(0);

macro += "TAB OPEN"+ crLF;
macro += "TAB T=2"+ crLF;
macro += "URL GOTO=http://{{getkeyword}}.{{domain}}/wp-admin/options-general.php?page=metaOptions"+ crLF;
macro += "TAG POS=1 TYPE=INPUT:TEXTAREA FORM=NAME:form1 ATTR=NAME:default_description CONTENT=" + description + crLF;
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:form1 ATTR=NAME:Submit&&VALUE:Update<SP>Options" + crLF;
macro += "WAIT SECONDS=1"+ crLF;

macro += "URL GOTO=http://{{getkeyword}}.{{domain}}/wp-admin/options-general.php"+ crLF;
macro += "TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:options.php ATTR=ID:blogdescription CONTENT=" + description + crLF;
macro += "TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:options.php ATTR=ID:submit" + crLF;
macro += "WAIT SECONDS=1"+ crLF;
macro += "TAB CLOSE"+ crLF;
macro += "TAB T=1"+ crLF;
iimPlay(macro);
}


หัวข้อ: Re: สอบถามเรื่อง imacro js หน่อยครับ ช่วยผมตรวจโค้ดหน่อยครับ +1
เริ่มหัวข้อโดย: Jindas ที่ 26 ตุลาคม 2012, 22:20:06
น่าจะตรงบรรทัดที่ 38 กับ 56 โดยเปลี่ยนจาก POS="1" เป็น POS=1 ลองดูนะครับ :wanwan019:


หัวข้อ: Re: สอบถามเรื่อง imacro js หน่อยครับ ช่วยผมตรวจโค้ดหน่อยครับ +1
เริ่มหัวข้อโดย: Nopzixcros ที่ 26 ตุลาคม 2012, 22:37:27
น่าจะตรงบรรทัดที่ 38 กับ 56 โดยเปลี่ยนจาก POS="1" เป็น POS=1 ลองดูนะครับ :wanwan019:

ขอบคุณครับ รันได้แล้ว แต่ว่าในส่วนนี้ asincall และ keyspace มันไม่ดึงค่าออกมาจากไฟล์ csv อะครับ

โค๊ด:
http://www.xxxx.com/?asin=" + asincall + "&accesskey=" + accesskey + "&secretkey=" + secretkey + "&tagid=" + trackingid + "&user=" + username + "&pass=" + password + "&keyword="+ keyspace +
 

รบกวนอีกนิดนะครับท่าน  :wanwan017:


หัวข้อ: Re: สอบถามเรื่อง imacro js หน่อยครับ ช่วยผมตรวจโค้ดหน่อยครับ +1
เริ่มหัวข้อโดย: pash ที่ 26 ตุลาคม 2012, 22:46:02
var reg = /\s+/g;   ==>> var reg = "/\s+/g";