Actinoogle 1.16 UK Frooglefeed utility for Actinic 6+

Please select your options and your latest exported datafeed from Actinic, then press UPLOAD.

ALL FIELDS ARE REQUIRED

Datafeed details Your Froogle FTP username:

Your Froogle FTP password:

Registered datafeed filename on Froogle: [e.g. 'myfeed.txt']

Add VAT at 17.5%? [required for UK feeds, Actinic does NOT do this automatically]

Upload feed to Froogle? [uncheck this to display the feed on your screen instead]

Actinic datafile to process:

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") { ?>

ERROR: This does not seem to be a valid Actinic datafeed

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=YES

Stopping 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

Second pass.. filtering for bad data$vat_text

"; $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.

"; if ($_POST["ftp"]=="on") { echo "

Uploading feed to Froogle...

"; $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.

\n"; } else { if (!($ft = fopen($ftp_feedname, 'w'))) die ("Cannot open output feed file, there is an error with permissions on your server."); fwrite($ft,$newcontent); fclose($ft); echo "

PROCESSED FEED AVAILABLE AT: $ftp_feedname

\n"; } } } ?>

Actinoogle ©2005 Draftlight Networks