Please select your options and your latest exported datafeed from Actinic, then press UPLOAD.
ALL FIELDS ARE REQUIRED
Processing ".$fn["name"].""; if ($_POST["vat"]=="on") { $apply_vat=1; $vat_text=" and adding VAT at 17.5%"; } if (!($fp = fopen($fn["tmp_name"], 'r'))) die ("Cannot open uploaded feed file - there is an error with your server."); $dump = fgets($fp,100); if ($dump!="# html_escaped=YES") { ?>
The file you have uploaded is not a valid datafeed file, or has already been processed. Actinoogle expects
the first two lines of the feed file to say:
# html_escaped=YES # quoted=YESStopping further processing. Please press BACK on your browser and select a valid feed file. First pass.. removing newlines and headers
";
echo "
removing header: $dump";
$dump = fgets($fp,100);
echo "
removing header: $dump";
$dump = fgets($fp,100);
echo "
removing header: $dump";
while (!feof($fp)) {
$cont .= fread($fp, 1024);
}
fclose($fp);
echo "
removing line breaks... ";
$cont = str_replace($nl," ",$cont);
$cont = str_replace($cr,"",$cont);
$cont = str_replace("\"GBP\" ","\"GBP\"".$nl,$cont);
echo "done
";
$newcontent = "product_url".$tab."name".$tab."description".$tab."price".$tab."image_url".$tab."category".$tab."offer_id".$tab."currency".$nl;
$tempfile_arry = explode($nl,$cont);
while (list($lineNumber,$line) = each ($tempfile_arry)) {
$i++;
if (substr_count($line,$tab)==7) {
$arry = explode($tab,$line);
$prlen = strlen($arry[3])-2;
if ($prlen>3) {
$price = substr($arry[3],1,$prlen);
if ($price==0) {
$rej++;
echo "
--skipped zero priced item: " . $arry[1] . "\n";
} else {
if ($apply_vat==1) {
$price2 = number_format(round($price * 117.5)/100, 2, '.', '');
$arry[3] = "\"".$price2."\"";
$line = implode($tab,$arry);
}
$newcontent .= $line.$nl;
}
}
}
}
echo "
$i lines processed, $rej removed.
";
$ftp_url = "ftp://".$ftp_username.":".$ftp_password."@hedwig.google.com/".$ftp_feedname;
echo "writing to remote file " . $ftp_feedname . " on hedwig.google.com, with username " . $ftp_username."
";
if (!($ft = fopen($ftp_url, 'w'))) die ("Cannot open FTP link to hedwig.google.com.");
fwrite($ft,$newcontent);
fclose($ft);
echo "UPLOAD COMPLETE. You should now log into your Froogle Merchant account to check progress, but please note";
echo " that it can take up to 20 minutes for the new upload to show on your account.
PROCESSED FEED AVAILABLE AT: $ftp_feedname
\n"; } } } ?>