Hoi allemaal
Ik heb een dag aanbiedingen site gemaakt wat al een tijdje goed liep qua feed.
Op 1 of andere dag werkte me cronjob niet meer en bleek dat daisycon de instellingen heeft veranderd..
Het was een Soap Api verhaal maar is nu iets nieuws geworden waar ik dus niet uit kom.
- ik weet niet wat ik moet aanpassen en hoe heeft iemand een idee ?
(hieronder zien jullie hoe het was )
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); include "config.php";
error_reporting(E_ALL ^ E_NOTICE);
include dirname(__FILE__) . "/../third_party/zanox/ApiClient.php";
class cronjob extends Config{
public function daisycon(){
set_time_limit(0);
echo '<pre>';
Cronjob START','Cronjob START');
$path = $_SERVER["DOCUMENT_ROOT"] . '/upload/aanbiedingen/';
if (!file_exists($path)){
@mkdir($path,0755,true);
}else{
@chmod($path,0755);
}
$options = array(
'login' => $this->api_user,
'password' => md5($this->api_pass),
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'encoding' => 'utf-8',
'trace' => 1,
);
print_r($options);
$soap = new SoapClient("http://api.daisycon.com/publisher/soap/feed/wsdl/",$options);
$filter = array(
'media_id' => $this->api_media,
'type' => 'xml',
'encoding' => 'UTF-8'
);
print_r($filter);
$result = $soap->getFeeds($filter);
echo $result;
die();
$ids = '0';
if (is_array($result["return"])){
foreach ($result["return"] as $nr => $feed){
if ('http://xml.ds1.nl/update/?wi=' . $this->api_media . '&update=normal&type=xml&encoding=UTF-8&si=3758&xid=3760&ws=' != $feed->feed_link){
$xml = simplexml_load_file($feed->feed_link);
$done = 1;
$feed_id = 0;
$last_feedid = 0;
$brand_name = '';
$limit = 5;
foreach($xml->children() as $product){
if ($last_feedid != $feed_id){
$zanox = $this->db->get_where('zanox',array('feed_id' => $feed_id));
if (set_num($zanox->row()->amount) != 0){
$limit = $zanox->row()->amount;
}
$last_feedid = $feed_id;
}
if ($done <= $limit){
Ik heb een dag aanbiedingen site gemaakt wat al een tijdje goed liep qua feed.
Op 1 of andere dag werkte me cronjob niet meer en bleek dat daisycon de instellingen heeft veranderd..
Het was een Soap Api verhaal maar is nu iets nieuws geworden waar ik dus niet uit kom.
- ik weet niet wat ik moet aanpassen en hoe heeft iemand een idee ?
(hieronder zien jullie hoe het was )
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); include "config.php";
error_reporting(E_ALL ^ E_NOTICE);
include dirname(__FILE__) . "/../third_party/zanox/ApiClient.php";
class cronjob extends Config{
public function daisycon(){
set_time_limit(0);
echo '<pre>';
Cronjob START','Cronjob START');
$path = $_SERVER["DOCUMENT_ROOT"] . '/upload/aanbiedingen/';
if (!file_exists($path)){
@mkdir($path,0755,true);
}else{
@chmod($path,0755);
}
$options = array(
'login' => $this->api_user,
'password' => md5($this->api_pass),
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'encoding' => 'utf-8',
'trace' => 1,
);
print_r($options);
$soap = new SoapClient("http://api.daisycon.com/publisher/soap/feed/wsdl/",$options);
$filter = array(
'media_id' => $this->api_media,
'type' => 'xml',
'encoding' => 'UTF-8'
);
print_r($filter);
$result = $soap->getFeeds($filter);
echo $result;
die();
$ids = '0';
if (is_array($result["return"])){
foreach ($result["return"] as $nr => $feed){
if ('http://xml.ds1.nl/update/?wi=' . $this->api_media . '&update=normal&type=xml&encoding=UTF-8&si=3758&xid=3760&ws=' != $feed->feed_link){
$xml = simplexml_load_file($feed->feed_link);
$done = 1;
$feed_id = 0;
$last_feedid = 0;
$brand_name = '';
$limit = 5;
foreach($xml->children() as $product){
if ($last_feedid != $feed_id){
$zanox = $this->db->get_where('zanox',array('feed_id' => $feed_id));
if (set_num($zanox->row()->amount) != 0){
$limit = $zanox->row()->amount;
}
$last_feedid = $feed_id;
}
if ($done <= $limit){