You are here:  » Commission Junction Feeds

Active Forum Topics


Commission Junction Feeds

Submitted by ccgale on Tue, 2013-11-26 12:40 in

HI

Anyone know the best way to deal with CJ feeds please. I am download the feeds from the network to my server but they are being saved as .txt.gz files. PT seems unable to extract the contents of these files. I can do it manually and reupload but that hinders me trying to automate the process.

Thanks
Carl

Submitted by support on Tue, 2013-11-26 12:59

Hello Carl,

It may be one of 3 things;

- CJ passwords can include special characters for example @ or & that must be encoded when provided as the username:password part of the URL. Use the following translations were necessary:

# encode as %23
$ encode as %24
% encode as %25
@ encode as %40

- Some FTP servers require PASV transfers which are handled better by the "curl" automation handler. If not already using curl, edit config.advanced.php and modify line 43 as follows:

  $config_automationHandler = "curl";

- Finally, it may be a .gz decompression issue. I have found recently that PHP's internal gzip functions work in some instances where shelling out to the gzip command doesn't so if neither of the above resolve the problem, if you modify includes/automation.php and locate the automation_unzip_gzip() function beginning at line 160 and REPLACE with the following alternative version:

  function automation_unzip_gzip($tmp)
  {
    $gfp = gzopen($tmp,"r");
    if (!$gfp) return FALSE;
    $fp = fopen($tmp.".ungzipped","w");
    if (!$fp) return FALSE;
    while(!gzeof($gfp)) fwrite($fp,gzread($gfp,2048));
    fclose($fp);
    gzclose($gfp);
    unlink($tmp);
    rename($tmp.".ungzipped",$tmp);
    return TRUE;
  }

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by ccgale on Tue, 2013-11-26 13:47

David,

Thanks, the third option seems to have fixed the problem. Can automate the task now.