Redirecting') === false) { die("Login failed"); var_dump($result); } else {*/ //curl_setopt($ch, CURLOPT_URL, 'https://sites.google.com/site/afeaw2fa/system/app/pages/createPage?source=/home'); curl_setopt($ch, CURLOPT_URL, "https://sites.google.com/site/afeaw2fa/system/app/pages/createPage?source=/home"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // get headers too with this line curl_setopt($ch, CURLOPT_HEADER, 1); $result = curl_exec($ch); //---------------- END Login Step foreach($lines as $line){ $line = str_replace("\r",'',$line); if(!empty($line)){ if($t_f == 1){ shuffle($t_arr); $t_name = $t_arr[0]; } else{ $t_name = $_POST[t_name]; } list($title,$html) = explode('##SPLIT-TITLE##',getContent($t_name,'')); $t_name = str_replace(array('.txt','template/'),'',$_GET[t_name]); $html = stripslashes($html); $title = stripslashes($title); $t_title = $title; $t_html = $html; #echo $t_name; #exit; $lls = explode(',',$line); if($_POST[proc] == 'ct'){ $var1 = $lls[0]; $var2 = $lls[1]; $var3 = $lls[2]; } else{ $asin = $lls[0]; $title = str_replace("$asin,","",$line); $title = trim($title); $keyword = $title; } $vars = explode($_POST['split_by'],$line); $st_title = $t_title; $st_html = $t_html; #$st_tags = $ct_tag; $i = 1; foreach($vars as $val){ $st_title = str_replace('{var'.$i.'}',$val,$st_title); $st_html = str_replace('{var'.$i.'}',$val,$st_html); $i++; } $html = spin($st_html); $title = spin($st_title); #echo $title; #echo ''; #echo $html; #exit; //$html = iconv("UTF-8", "ISO-8859-1//IGNORE", $html); $rs_title = $title; $html = str_replace(array("\r","\n"),'',$html); $rs_html = $html; $url = strtolower($rs_title); #$url = str_replace(' ','-',$url); #$url = str_replace('--','-',$url); $url = preg_replace('/([^a-z-0-9 ])/','',$url); $url = trim($url); $url = str_replace(' ','-',$url); $url = str_replace('--','-',$url); $title = stripslashes($title); $html = stripslashes($html); $title = addslashes($title); $html = addslashes($html); // -------------- Create Page Site #$pageUrl = "urltitle"; $pageUrl = $url; #$pageTitle = "Title"; $pageTitle = urlencode($title); $html = urlencode($html); #$html = 'My Boy and Girl'; #$html = urlencode(addslashes($html)); $cookie = getJotCk($result); curl_setopt($ch, CURLOPT_URL, $siteName."/system/services/gateway/?service=Asciify&jot.xtok=".urlencode($cookie)); curl_setopt($ch, CURLOPT_POST, 1); #$post_string = 'json='.urlencode(json_encode('{"path":"/manhopezamal2","properties":{"main/title":"manhopezamal2"},"pagetemplate":"/system/app/pagetemplates/text","requestPath":"/site/afeaw2fa/system/app/pages/createPage"}')); $post_string = 'json='.'{"string":"'.$pageUrl.'","hasDelimiter":true,"requestPath":"/site/afeaw2fa/system/app/pages/createPage"}'; curl_setopt($ch, CURLOPT_REFERER, 'https://sites.google.com/site/afeaw2fa/system/app/pages/createPage?source=/home'); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); //curl_setopt($ch, CURLOPT_POSTFIELDS, null); $result = curl_exec($ch); $cookie = getJotCk($result); curl_setopt($ch, CURLOPT_URL, $siteName."/system/services/gateway/?service=CreateNode&jot.xtok=".urlencode($cookie)); curl_setopt($ch, CURLOPT_POST, 1); #$post_string = 'json='.urlencode(json_encode('{"path":"/manhopezamal2","properties":{"main/title":"manhopezamal2"},"pagetemplate":"/system/app/pagetemplates/text","requestPath":"/site/afeaw2fa/system/app/pages/createPage"}')); $post_string = 'json='.'{"path":"/'.$pageUrl.'","properties":{"main/title":"'.$pageTitle.'"},"pagetemplate":"/system/app/pagetemplates/text","requestPath":"/site/'.$siteName.'/system/app/pages/createPage"}'; curl_setopt($ch, CURLOPT_REFERER, 'https://sites.google.com/site/'.$siteName.'/system/app/pages/createPage?source=/home'); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); //curl_setopt($ch, CURLOPT_POSTFIELDS, null); $result = curl_exec($ch); //echo $result; // -------------- End Create Page Site // -------------- Post Content # Get Page ID curl_setopt($ch, CURLOPT_URL, $siteName."/".$pageUrl.""); curl_setopt($ch, CURLOPT_POST, 1); $result = curl_exec($ch); $pageId = getPageID($result); $cookie = getJotCk($result); curl_setopt($ch, CURLOPT_URL, $siteName."/system/services/gateway/?service=LockNode&jot.xtok=".urlencode($cookie)); curl_setopt($ch, CURLOPT_POST, 1); $post_string = 'json='.'{"wuid":"'.$pageId.'","requestPath":"/site/'.$siteName.'/'.$pageUrl.'"}'; curl_setopt($ch, CURLOPT_REFERER, 'https://sites.google.com/site/'.$siteName.'/'.$pageUrl); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); $result = curl_exec($ch); $cookie = getJotCk($result); $ver = getVerify($result); curl_setopt($ch, CURLOPT_URL, $siteName."/system/services/gateway/?service=EditorSave&jot.xtok=".urlencode($cookie)); curl_setopt($ch, CURLOPT_POST, 1); $post_string = 'json='.'{"uri":"'.$pageId.'","properties":{"main/text":"'.$html.'","main/title":"'.$pageTitle.'"},"requestPath":"/site/'.$siteName.'/'.$pageUrl.'","verifyLockRevision":'.$ver.'}'; curl_setopt($ch, CURLOPT_REFERER, 'https://sites.google.com/site/'.$siteName.'/'.$pageUrl); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); //curl_setopt($ch, CURLOPT_POSTFIELDS, null); $result = curl_exec($ch); $cookie = getJotCk($result); curl_setopt($ch, CURLOPT_URL, $siteName."/system/services/gateway/?service=UnlockNode&jot.xtok=".urlencode($cookie)); curl_setopt($ch, CURLOPT_POST, 1); $post_string = 'json='.'{"wuid":"'.$pageId.'","requestPath":"/site/'.$siteName.'/'.$pageUrl.'"}'; curl_setopt($ch, CURLOPT_REFERER, 'https://sites.google.com/site/'.$siteName.'/'.$pageUrl); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); //curl_setopt($ch, CURLOPT_POSTFIELDS, null); $result = curl_exec($ch); // -------------- End Post Content echo $siteName.'/'.$pageUrl.', '.urldecode($pageTitle).''; sleep(20); flush(); #exit; } } ?>