Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

edgeoi feed error


liz0

Recommended Posts

OK My problem is solved. I just received a reply from google base and my images are working. This is the reply that I received from them.

 

"Thanks for your email. Due to system constraints, there is a delay between

when you upload your file and when our server caches your images. During

this period, you will see the "image not available" image for your items."

 

Just wanted to update you.

 

Thanks,

 

Jeff

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

  • 2 weeks later...

Hi

 

I get this message in IE

 

HTTP/1.1 301 Moved Permanently Date: Sun, 23 Jul 2006 12:57:35 GMT Server: Apache/2.0.46 (Red Hat) Location: http://www.edgeio.com/RPC2 Content-Length: 318 Connection: close Content-Type: text/html; charset=iso-8859-1

Moved Permanently

The document has moved here.

 

 

--------------------------------------------------------------------------------

 

Apache/2.0.46 (Red Hat) Server at www2.edgeio.com Port 80

Edgeio File

 

And this message from Edgeio

 

<?xml version="1.0" ?>

- <methodResponse>

- <fault>

- <value>

- <struct>

- <member>

<name>faultCode</name>

- <value>

<int>7</int>

</value>

</member>

- <member>

<name>faultString</name>

- <value>

<string>Invalid XML or incomplete document</string>

</value>

</member>

</struct>

</value>

</fault>

</methodResponse>

 

Any ideas please.

 

Thanks

 

Mike

Link to comment
Share on other sites

Same problem here - had been working fine but recently giving the same 301 error.

 

Any ideas?

I started gettting the same error.

 

Also, I am not sure exactly where the loop occurs.

I need to kill the Categories section of the Googlebase feed.

We use the Multiple categories per item contrib and well this is the word from Google on the subject

 

Duplicate items: Please be sure to post each item only once.

 

So what I would need to know is how to make the Google end only list the products by Product ID and move on to the next, since most all of our products show up in at least two or more catagories.

If you choose not to decide you still have made a choice, I will choose a purpose clear, I will choose Free Will. --Neal Peart - Rush

Link to comment
Share on other sites

I've been hacking on this contribution to get it to work with google. Main problems so far: not showing prices with tax or detecting special prices, not labelling products with categories and using the wrong time format. I'm pasting the patch so far here and would welcome any comments you can offer.

 

Use this to update your file with a patch tool (programmer editors like Emacs have them, or in the worst case, paste it to a file called edgeio.patch and then use a typical GNU/Linux command line like: patch admin/rss_edgeio.php <edgeio.patch, but watch for lines it couldn't figure out). It will probably fail on the second chunk if you've already configured siteUrl and so on, but the change there is pretty simple: rename language to xmllanguage and set ttl to 30 (google max is 31, as far as I can see).

 

I can see some other possible improvements, but this works for me so far. Please let me know here whether it works for you. Should I add this to the contribution page?

 

--- admin/rss_edgeio.php	2006-07-11 18:12:46.000000000 +0100
+++ admin/rss_edgeio.php.mod	2006-07-25 13:03:28.000000000 +0100
@@ -5,6 +5,8 @@
**********************************************************
*by Andrew Yasinsky ([email protected])

+*Updated by MJ Ray
+
PLEASE READ:
This feed constructs default product and image urls
If your images or urls are custom then i assume you know how to integrate 'em here.
@@ -13,6 +15,10 @@
*/

/*INCLUDE NEEDED OS COMMERCE CLASSES*/
+  //MJR: use normal boot instead
+  require('includes/application_top.php');
+  
+  /*
  require('includes/configure.php');
  require(DIR_WS_FUNCTIONS . 'database.php');
  tep_db_connect() or die('Unable to connect to database server!');
@@ -34,13 +40,13 @@
$feedUrl=''; //URL to $OutFile i.e. [url="http://www.mysite.com/feeds/"]http://www.mysite.com/feeds/[/url] 
$imageUrl = ''; //Base URL for images i.e. [url="http://www.mysite.com/images/"]http://www.mysite.com/images/[/url]
$productUrl = ''; //Base url for products i.e. [url="http://www.mysite.com/product_info.php?products_id="]http://www.mysite.com/product_info.php?products_id=[/url]
-$language='en-us';
+$xmllanguage='en-us';
$currency='USD'; //ISO Currency code i.e. GBP, EUR
$locationCity='City'; //location of the producti.e. New York
$locationState='State'; //State i.e. CA 
$locationZip='ZIP'; //ZIP
$locationCountry='USA';//COUNTRY
-$ttl=60; //Time to expiration in days minimum 30 max 90
+$ttl=30; //Time to expiration in days minimum 30 max 90 //MJR: max 31 for google
$paymentAccepted=array('Cash','Visa','MasterCard','AmericanExpress'); // these values should be the same as on google base xml feed spec
$locationAddress='Your Street Address, City,State,Zip';

@@ -82,7 +88,7 @@

//******************************************************
//Retrieve all product/products_description information feel free to change this
-$result=tep_db_query("select * from products p, products_description pd, products_to_categories ptc where p.products_id=pd.products_id and p.products_id=ptc.products_id and p.products_quantity>0 and p.products_status=1 " . $limit);
+$result=tep_db_query("select * from products p, products_description pd, products_to_categories ptc where p.products_id=pd.products_id and p.products_id=ptc.products_id and p.products_quantity>0 and p.products_status=1 group by p.products_id" . $limit);


if($edgeio){
@@ -95,11 +101,11 @@
$output.='<title>'.$feedTitle.'</title>'."\n";
$output.='<link>'.$siteUrl.'</link>'."\n";
$output.='<feed>'.$feedUrl.$fileEdgeio.'</feed>'."\n";
-$output.='<language>'.$language.'</language>'."\n";
+$output.='<language>'.$xmllanguage.'</language>'."\n";
$output.='<pubDate>'.date("r").'</pubDate>'."\n";
$output.='<lastBuildDate>'.date("r").'</lastBuildDate>'."\n";
$output.='<docs>http://blogs.law.harvard.edu/tech/rss</docs>'."\n";
-$output.='<generator>Edgeio publishing script for oSCommerce 1.2</generator>'."\n";
+$output.='<generator>Edgeio publishing script for osCommerce 1.7</generator>'."\n";


while($row = tep_db_fetch_array($result)){
@@ -112,7 +118,7 @@
	$output.='		<description>'.xmlentities(strip_tags($row['products_description']))."\n";
	$output.='			<![CDATA['."\n";
	$output.='			<img src="'.$imageUrl . $row['products_image'] . '" />'."\n" ;
-	$output.='			<span class="price">'.$currency.' '.number_format($row['products_price'], 2, '.', '').'</span>'."\n";
+	$output.='			<span class="price">'.$currency.' '.number_format(getprice($row), 2, '.', '').'</span>'."\n";
	$output.='			<abbr class="dtexpired" title="'.get_iso_8601_date(time() + ($ttl * 24 * 60 * 60)).'">'.date("F j, Y",strtotime("+".$ttl." day")).'</abbr>'."\n";
	$output.='			]]>'."\n";
	$output.='		</description>'."\n";
@@ -167,16 +173,21 @@
	$output.='		<description>'.xmlentities(strip_tags($row['products_description']))."</description>\n";
	$output.='		<link>'.$productUrl . $row['products_id'] .'</link>'."\n";
 	$output.='		<g:image_link>'.$imageUrl . $row['products_image'] .'</g:image_link>'."\n";
-	$output.='		<guid isPermaLink="false">'.xmlentities($siteUrl.$row['products_id']).'</guid>'."\n";
+	$output.='		<guid isPermaLink="false">'.xmlentities($productUrl.$row['products_id']).'</guid>'."\n";
	$output.='		<g:expiration_date>'.get_iso_8601_date(time() + ($ttl * 24 * 60 * 60)).'</g:expiration_date>'."\n";
	$output.='		<g:currency>'.$currency.'</g:currency>'."\n";
-	$output.='		<g:price>'.number_format($row['products_price'], 2, '.', '').'</g:price>'."\n";
+	$output.='		<g:price>'.number_format(getprice($row), 2, '.', '').'</g:price>'."\n";
	$output.='		<g:upc>'.$row['products_model'].'</g:upc>'."\n";
	$output.='		<g:quantity>'.$row['products_quantity'].'</g:quantity>'."\n";
	foreach($paymentAccepted as $key=>$value){
		$output.='		<g:payment_accepted>'.$value.'</g:payment_accepted>'."\n";	
	}
	$output.='		<g:location>'.xmlentities($locationAddress.','.$locationCity.','.$locationState.','.$locationZip.','.$locationCountry).'</g:location>'."\n";
+	if(isset($categorytag[$row['categories_id']])){
+	 foreach($categorytag[$row['categories_id']] as $key=>$value){
+		$output.='			<g:label>'.xmlentities($value).'</g:label>'."\n";
+	 }
+ 	}
 	$output.='	</item>'."\n";
}
$output.='</channel>'."\n";
@@ -297,10 +308,12 @@

function get_iso_8601_date($int_date) {
   //$int_date: current date in UNIX timestamp
-   $date_mod = date('Y-m-d\TH:i:s', $int_date);
-   $pre_timezone = date('O', $int_date);
-   $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
-   $date_mod .= $time_zone;
+   //MJR: remove \TH:i:s to stop google errors
+   $date_mod = date('Y-m-d', $int_date);
+   //MJR: don't add timezone - google hates it
+   //$pre_timezone = date('O', $int_date);
+   //$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
+   //$date_mod .= $time_zone;
   return $date_mod;
}

@@ -308,5 +321,22 @@
   return str_replace ( array ( '&', '"', "'", '<', '>', '?' ), array ( '&' , '"', ''' , '<' , '>', ''' ), $string );
}

+//MJR: from main catalogue general.php
+  function tep_get_products_special_price($product_id) {
+    $product_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$product_id . "' and status");
+    $product = tep_db_fetch_array($product_query);
+
+    return $product['specials_new_products_price'];
+  }
+
+//MJR: specials price handling from product_info.php
+function getprice($product_info_values) {
+    if ($new_price = tep_get_products_special_price($product_info_values['products_id'])) {
+      $products_price = $new_price*(100+tep_get_tax_rate($product_info_values['products_tax_class_id']))/100;
+    } else {
+      $products_price = $product_info_values['products_price']*(100+tep_get_tax_rate($product_info_values['products_tax_class_id']))/100;
+    }
+    return $products_price;
+}

?>
\ No newline at end of file

Link to comment
Share on other sites

So what I would need to know is how to make the Google end only list the products by Product ID and move on to the next, since most all of our products show up in at least two or more catagories.

 

I think the 'group by p.products_id' in my patch does that. Hope it works for you.

Link to comment
Share on other sites

I think the 'group by p.products_id' in my patch does that. Hope it works for you.

I am really not sure what you were trying to acomplish.

 

A very simple solution to stop the script from listing every item as it is in every categorie, ie.. with store items are listed in more than one categorie so the script would put the items in the feed once for each category.

 

was simply to change:

 

$result=tep_db_query("select * from products p, products_description pd, products_to_categories ptc where p.products_id=pd.products_id and p.products_id=ptc.products_id and p.products_status=1 " . $limit);

 

To:

 

$result=tep_db_query("select * from products p, products_description pd where p.products_id=pd.products_id and p.products_status=1 " . $limit);

 

What is missing are two components. 1. The Products_to_categories ptc both ends

2. we removed the and p.products_quantity>0 since we dont usually keep the quantity in the catalog.

If you choose not to decide you still have made a choice, I will choose a purpose clear, I will choose Free Will. --Neal Peart - Rush

Link to comment
Share on other sites

I am really not sure what you were trying to acomplish.

 

For me, that GROUP BY stops double-listing products which appear in two categories.

 

I guess that maybe we're using different 'multiple categories' contributions.

Link to comment
Share on other sites

  • 3 weeks later...

Please help I cant get this to work. I am trying to export my specials price to googlebase. thanks

This should help with the specials pricing problem, if somebody could check it through,

 

If you find (around line 158):

 

while($row = tep_db_fetch_array($result)){

 

and add this:

 

$sql2 = "SELECT

specials_new_products_price

FROM specials

WHERE

products_id = " . $row['products_id'] . " and

status = 1

ORDER BY

specials_id DESC"

;

$result2 = tep_db_query($sql2);

$ll = 1;

$row2 = tep_db_fetch_array($result2);

if( $row2 ){

$row['products_price'] = $row2['specials_new_products_price'];

}

Link to comment
Share on other sites

Well I have tried til I have pulled my hair out !!!!

 

What ever I do I get this warning any clues? Any help greatly appreciated :o)

 

 

Warning: fopen(): open_basedir restriction in effect. File(/www.########.co.uk/feeds/google_feed.xml) is not within the allowed path(s): (/tmp:/usr/share/pear:/home/fhlinux184/p/########.co.uk/user) in /home/fhlinux184/p/##########.co.uk/user/htdocs/admin/rss_edgeio.php on line 229

 

Warning: fopen(/www.#########.co.uk/feeds/google_feed.xml): failed to open stream: Operation not permitted in /home/fhlinux184/p/#########.co.uk/user/htdocs/admin/rss_edgeio.php on line 229

 

Warning: fwrite(): supplied argument is not a valid stream resource in /home/fhlinux184/p/#######.co.uk/user/htdocs/admin/rss_edgeio.php on line 230

 

Warning: fclose(): supplied argument is not a valid stream resource in /home/fhlinux184/p/###########.co.uk/user/htdocs/admin/rss_edgeio.php on line 231

Google File

Regards

 

Steve

Link to comment
Share on other sites

My .xml file is generating empty. Any ideas? This is whats coming up in the google_feed.xml file:

<rss version="2.0">

<channel>

<title>ElectricQuarter</title>

<description>ElectricQuarter</description>

<link>http://www.electricquarter.com</link>

</channel>

</rss>

 

And here is my rss_edgeio.php file:

 

<?php

/*

**********************************************************

*** Edgeio.com and googlebase feed - v. 1.0 (May '06) ***

**********************************************************

*by Andrew Yasinsky ([email protected])

*/

 

/*INCLUDE NEEDED OS COMMERCE CLASSES*/

require('includes/configure.php');

require(DIR_WS_FUNCTIONS . 'database.php');

tep_db_connect() or die('Unable to connect to database server!');

require(DIR_WS_FUNCTIONS . 'general.php');

/*END STOCK OS COMMERCE INCLUDE*/

 

$edgeio=true; //enable edge io

$googlebase=true; //enable google base

$dryrun=true; //whether or not execute actual upload to both or stop at file generation

$limit=' LIMIT 500'; //nice to limit number of posts for debug delete for production

 

//CHANGE PARAMETERS BELOW///

$feedDirectory = "/xxxxxxxxx/htdocs/feeds/"; //"CHANGEME-full-path-to-file-with-777-dir-and-file-permissions.yahoo-outfile.txt";

 

$fileEdgeio="edgeio_feed.xml";

$fileGoogle="google_feed.xml";

$feedTitle='ElectricQuarter'; //Feed Title

 

$feedDescription='ElectricQuarter'; //Feed Title

 

$siteUrl='http://www.electricquarter.com'; //Site URL

 

$feedUrl='http://www.electricquarter.com/feeds/'; //URL to $OutFile

$imageUrl = 'http://www.electricquarter.com/images/'; //Base URL for images

 

$productUrl = 'http://www.electricquarter.com/product_info.php/products_id='; //Base url for products could be products_info.php?products_id=XXX if you dont use mod rewrite

 

$language='en-us';

 

$currency='USD'; //ISO Currency code i.e. GBP, EUR

$locationCity='Franklin'; //location of the product

$locationState='NH';

$locationZip='03235';

$locationCountry='USA';

$ttl=60; //Time to expiration in days minimum 30 max 90

$paymentAccepted=array('MO/Check','Visa','MasterCard','Paypal'); // these values should be the same as on google base xml

 

feed spec

$locationAddress='4 Jeannette St.';

 

//GOOGLE SPECIFIC Settings

$destination_file = "xxxxxxxxx.xml"; //the upload file name specified on google base

$ftp_server = "uploads.google.com" ; //google ftp server

$ftp_user_name = "xxxxxxxxx"; //ftp user name

$ftp_user_pass = "xxxxxxxxx"; //ftp password

$ftp_directory = ""; // leave blank

 

//***********************

// This query is required if you want to use categories names as search and grouping tags in EDGEIO.COM serach engine

//select categories, the categories names will be used as tags and keywords for listings

$result=tep_db_query("SELECT * FROM categories c, categories_description cd WHERE c.categories_id = cd.categories_id");

$categories=array();

while($row = tep_db_fetch_array($result)){

$categories[$row['categories_id']]['name']=htmlspecialchars($row['categories_name']);

$categories[$row['categories_id']]['parent']=$row['parent_id'];

}

 

$categorytag=array();

//now find path from this category to its parent and then to root so their names can be used as tags

foreach($categories as $key=>$value){

$end=0;

$tags=array($value['name']);

$nextid=$value['parent'];

do{

if($nextid!=0){

array_push($tags,$categories[$nextid]['name']);

$nextid=$categories[$nextid]['parent'];

}else{

$end=1;

}

}while($end!=1);

 

$categorytag[$key]=$tags;

}

 

 

//******************************************************

//Retrieve all product/products_description information feel free to change this

$result=tep_db_query("select * from products p, products_description pd, products_to_categories ptc where

 

p.products_id=pd.products_id and p.products_id=ptc.products_id and p.products_quantity>0 and p.products_status=1 " . $limit);

 

 

if($edgeio){

/********************

BUILD EDGEIO FILE

********************/

$output='<?xml version="1.0" encoding="ISO-8859-1" ?>'."\n";

$output.='<rss version="2.0" xmlns:edgeio="http://www.edgeio/com/api/v1">'."\n";

$output.='<channel>'."\n";

$output.='<title>'.$feedTitle.'</title>'."\n";

$output.='<link>'.$siteUrl.'</link>'."\n";

$output.='<feed>'.$feedUrl.$fileEdgeio.'</feed>'."\n";

$output.='<language>'.$language.'</language>'."\n";

$output.='<pubDate>'.date("r").'</pubDate>'."\n";

$output.='<lastBuildDate>'.date("r").'</lastBuildDate>'."\n";

$output.='<docs>http://blogs.law.harvard.edu/tech/rss</docs>'."\n";

$output.='<generator>Edgeio publishing script for oSCommerce 1.1</generator>'."\n";

 

 

while($row = tep_db_fetch_array($result)){

 

$output.=' <item>'."\n";

$output.=' <guid>'.xmlentities($siteUrl.$row['products_id']).'</guid>'."\n";

$output.=' <pubDate>'.date("r").'</pubDate>'."\n";

$output.=' <title>'.xmlentities(strip_tags($row['products_name']). " - " . $row['products_model']) .'</title>'."\n";

$output.=' <link>'.$productUrl . $row['products_id'] .'</link>'."\n";

$output.=' <description>'.xmlentities(strip_tags($row['products_description']))."\n";

$output.=' <![CDATA['."\n";

$output.= <img src="'.urlencode($imageUrl . $row['products_image]) . '" />'."\n" ;

$output.=' <span class="price">'.$currency.' '.number_format($row['products_price'], 2, '.', '').'</span>'."\n";

$output.=' <abbr class="dtexpired" title="'.get_iso_8601_date(time() + ($ttl * 24 * 60 * 60)).'">'.date("F j, Y",strtotime

 

("+".$Ttl." day")).'</abbr>'."\n";

$output.=' ]]>'."\n";

$output.=' </description>'."\n";

$output.=' <category>listing</category>'."\n";

$output.=' <category>for+sale</category>'."\n";

$output.=' <category>city:'.urlencode($locationCity).'</category>'."\n";

$output.=' <category>state:'.urlencode($locationState).'</category>'."\n";

$output.=' <category>zip:'.urlencode($locationZip).'</category>'."\n";

$output.=' <category>country:'.urlencode($locationCountry).'</category>'."\n";

if(isset($categorytag[$row['categories_id']])){

foreach($categorytag[$row['categories_id']] as $key=>$value){

$output.=' <category>'.urlencode($value).'</category>'."\n";

}

}

$output.=' </item>'."\n";

}

 

$output.='</channel>'."\n";

$output.='</rss>'."\n";

 

if ( file_exists( $feedDirectory.$fileEdgeio ) )

unlink($feedDirectory.$fileEdgeio );

 

$fp = fopen($feedDirectory.$fileEdgeio , "w" );

$fout = fwrite($fp , $output );

fclose( $fp );

if(!$dryrun){

echo sendPing($feedTitle,$siteUrl,$feedUrl.$fileEdgeio);

}

echo '<p><a href="'.$feedUrl.$fileEdgeio.'">Edgeio File</a><p>';

}

 

mysql_data_seek($result, 0);//rewind the dataset

 

if($googlebase){

/********************

BUILD GOOGLE FILE

********************/

 

$output='<?xml version="1.0" encoding="UTF-8" ?>'."\n";

$output.='<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">'."\n";

$output.='<channel>'."\n";

$output.='<title>'.$feedTitle.'</title>'."\n";

$output.='<description>'.$feedDescription.'</description>'."\n";

$output.='<link>'.$siteUrl.'</link>'."\n";

 

 

while($row = tep_db_fetch_array($result)){

 

$output.=' <item>'."\n";

$output.=' <title>'.xmlentities(strip_tags($row['products_name']). " - " . $row['products_model']) .'</title>'."\n";

$output.=' <description>'.xmlentities(strip_tags($row['products_description']))."</description>\n";

$output.=' <link>'.$productUrl . $row['products_id'] .'</link>'."\n";

$output.=' <g:image_link>'.urlencode($imageUrl . $row['products_image']) .'</g:image_link>'."\n";

$output.=' <guid isPermaLink="false">'.xmlentities($siteUrl.$row['products_id']).'</guid>'."\n";

$output.=' <g:expiration_date>'.get_iso_8601_date(time() + ($ttl * 24 * 60 * 60)).'</g:expiration_date>'."\n";

$output.=' <g:currency>'.$currency.'</g:currency>'."\n";

$output.=' <g:price>'.number_format($row['products_price'], 2, '.', '').'</g:price>'."\n";

$output.=' <g:upc>'.$row['products_model'].'</g:upc>'."\n";

//$output.=' <g:quantity>'.$row['products_quantity'].'</g:quantity>'."\n";

foreach($paymentAccepted as $key=>$value){

$output.=' <g:payment_accepted>'.$value.'</g:payment_accepted>'."\n";

}

$output.=' <g:location>'.xmlentities

 

($locationAddress.','.$locationCity.','.$locationState.','.$locationZip.','.$locationCountry).'</g:location>'."\n";

$output.=' </item>'."\n";

}

$output.='</channel>'."\n";

$output.='</rss>'."\n";

 

if ( file_exists( $feedDirectory.$fileGoogle ) )

unlink( $feedDirectory.$fileGoogle );

 

$fp = fopen( $feedDirectory.$fileGoogle , "w" );

$fout = fwrite( $fp , $output );

fclose( $fp );

if(!$dryrun){

$result=ftp_file( $ftp_server, $ftp_user_name, $ftp_user_pass, $feedDirectory.$fileGoogle, $ftp_directory,

 

$destination_file);

}

echo '<a href="'.$feedUrl.$fileGoogle.'">Google File</a>';

}

 

/*********************************

***********THE END FOLKS**********

*********************************/

 

 

//--EDGEIO.COM --CLASS CODE DO NOT CHANGE CODE BELOW THIS LINE--//

 

 

function sendPing($name="", $url="", $rss="") {

$fp = fsockopen("www.edgeio.com", 80, &$errnum, &$errstr);

 

if(!$fp) {

return "$errstr ($errnum)<br>\n";

}

 

if ($rss != "") {

$method = "weblogUpdates.extendedPing";

} else {

$method = "weblogUpdates.ping";

}

 

$xml = "<?xml version=\"1.0\"?><methodCall><methodName>" .$method .

"</methodName><params><param><value>$name</value></param><param><value>".htmlspecialchars(canonical_url

 

($url))."</value></param>";

if ($rss != "") $xml .= "<param><value>foo</value></param><param><value>".htmlspecialchars(canonical_url

 

($rss))."</value></param>";

$xml .= "</params></methodCall>";

 

$len = strlen($xml);

fputs($fp,"POST /RPC2 HTTP/1.0\r\n");

fputs($fp,"Content-Type: text/xml\r\n");

fputs($fp,"Content-length: $len\n\n");

fputs($fp,$xml);

 

$output="";

while(!feof($fp)) $output.=fgets($fp,4096);

fclose($fp);

 

return $output;

}

 

function canonical_url($url)

{

$url = trim($url);

if (substr($url,0,7)!="http://") $url = "http://".$url;

$u = @parse_url($url);

if (!$u) return "";

if (!$u['path'] && !$u['query'] && !$u['fragment']) $url .= "/";

return $url;

}

 

//Start FTP to Google Base

 

function ftp_file( $ftpservername, $ftpusername, $ftppassword, $ftpsourcefile, $ftpdirectory, $ftpdestinationfile )

{

// set up basic connection

$conn_id = ftp_connect($ftpservername);

if ( $conn_id == false )

{

echo "FTP open connection failed to $ftpservername <BR>\n" ;

return false;

}

 

// login with username and password

$login_result = ftp_login($conn_id, $ftpusername, $ftppassword);

 

// check connection

if ((!$conn_id) || (!$login_result)) {

echo "FTP connection has failed!<BR>\n";

echo "Attempted to connect to " . $ftpservername . " for user " . $ftpusername . "<BR>\n";

return false;

} else {

echo "Connected to " . $ftpservername . ", for user " . $ftpusername . "<BR>\n";

}

 

if ( strlen( $ftpdirectory ) > 0 )

{

if (ftp_chdir($conn_id, $ftpdirectory )) {

echo "Current directory is now: " . ftp_pwd($conn_id) . "<BR>\n";

} else {

echo "Couldn't change directory on $ftpservername<BR>\n";

return false;

}

}

 

ftp_pasv ( $conn_id, true ) ;

// upload the file

$upload = ftp_put( $conn_id, $ftpdestinationfile, $ftpsourcefile, FTP_ASCII );

 

// check upload status

if (!$upload) {

echo "$ftpservername: FTP upload has failed!<BR>\n";

return false;

} else {

echo "Uploaded " . $ftpsourcefile . " to " . $ftpservername . " as " . $ftpdestinationfile . "<BR>\n";

}

 

// close the FTP stream

ftp_close($conn_id);

 

return true;

}

 

function get_iso_8601_date($int_date) {

//$int_date: current date in UNIX timestamp

$date_mod = date('Y-m-d\TH:i:s', $int_date);

$pre_timezone = date('O', $int_date);

$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);

$date_mod .= $time_zone;

return $date_mod;

}

 

function xmlentities($string) {

return str_replace ( array ( '&', '"', "'", '<', '>', '?' ), array ( '&' , '"', ''' , '<' , '>', '''

 

), $string );

}

 

 

?>

Link to comment
Share on other sites

Well I have tried til I have pulled my hair out !!!!

 

What ever I do I get this warning any clues? Any help greatly appreciated :o)

Warning: fopen(): open_basedir restriction in effect. File(/www.########.co.uk/feeds/google_feed.xml) is not within the allowed path(s): (/tmp:/usr/share/pear:/home/fhlinux184/p/########.co.uk/user) in /home/fhlinux184/p/##########.co.uk/user/htdocs/admin/rss_edgeio.php on line 229

 

You're getting that because it's trying to write to /www.######.co.uk/feeds/ instead of /home/fhlinux184/p/######.co.uk/user/htdocs/feeds/ and that's not allowed by your hosting provider's security defaults - correctly IMO.

 

In other words, your $feedDirectory is wrong for your hosting provider. Replace the www.#######.co.uk with home/fhlinux184/p/######.co.uk/user/htdocs

 

Hope that helps!

Link to comment
Share on other sites

My .xml file is generating empty. Any ideas?

 

Try running the SELECT statements on the database (mysqlclient, phpmyadmin or whatever). They weren't quite right for my shop, so maybe they're not quite right for yours either.

Link to comment
Share on other sites

  • 1 month later...

Hello!

 

First of all The Creator of this Mod is the BEST!

What a great and easy mod this is! I LOVE IT!

 

Now I have a FEW Questions about this...

 

1) I wanted to put in an OS affiliate ref ID to track visits from this, but when I did that it did not give a feed, It only worked with out the ref=[iD] Any Ideas why, I'm not complaining having it with out, but would be great with!

 

2) I'd like to use this mod as it says, for other purposes that just edgeio, but since I have SO many products about 2,500 + I'd like to know if I can have the program break up my products in to the different catagories such as products from

http://www.autographdealer.com/index.php?cPath=32

http://www.autographdealer.com/index.php?cPath=35

ect? We don't do sub cats so that should be easier I'd think?

 

3) also wondering if I could set this us to just Syndicate the most viewed or best sellers also?

 

Ideally I'd like to offer about 10 feed options that would fit the Syndicates needs

 

4) is there a way that the Syndicates could insert their ref=ID into my feeds so that they could not only Syndicate but get paid for sales?

 

Sorry I'm asking so many what I'm sure are stupid questions, but I'm VERY new to RSS and Need a good lesson :-" I guess lol

 

Thanks in advance for your forthcoming help

Greg

Link to comment
Share on other sites

  • 2 months later...
Try running the SELECT statements on the database (mysqlclient, phpmyadmin or whatever). They weren't quite right for my shop, so maybe they're not quite right for yours either.

 

Hi mjr,

 

I have the same problem (an XML file with no products in it). The SELECT statement also returns 0 results for me.

How did you modified the query to fix that?

 

Thanks,

Link to comment
Share on other sites

Hi mjr,

 

I have the same problem (an XML file with no products in it). The SELECT statement also returns 0 results for me.

How did you modified the query to fix that?

 

Thanks,

 

 

I finally found the problem. The though came to my mind that I was not using the stock management for this shop, so all the products had the quantity of "0", which made the SELECT query return 0 products because of that part of the query:

 

and p.products_quantity>0

 

So I simply removed it from the query and now it works well.

 

Regards,

Link to comment
Share on other sites

  • 3 months later...

I just installed this contribution with the "maestro" fix where it tells me to mod file marketing.php I do not have a file with that name?

Any ideas?

Link to comment
Share on other sites

I got an email from Google saying this,

 

"Include additional required attributes: We noticed that you haven't

included some of the required attributes in your "Products" bulk upload.

The more information you provide, the better we will be able to match your

items to users' queries. For a list of required attributes, please visit

the following link:

 

http://base.google.com/base/help/products.html"

 

What can be missing? I did email them back asking but so far no replay.

 

I'm not sure if the automatic Edgeio uploads work so I enabled the google_feed.xml and uploaded the file manual.

 

How can you tell if the edgeio automatic upload is working?

 

Thank you

 

www.koolkatjazz.com

Edited by pederb
Link to comment
Share on other sites

  • 5 months later...

Hello,

 

I have all my products listed 3 times each. I think it's because I have 3 different languages in my catalog. Is there any way to make the products list just once instead of all 3 times? Any help will be appreciated.

 

Thanks.

Link to comment
Share on other sites

  • 1 month later...

Just upped and went to the admin url... got this error

 

1146 - Table 'fnjrtbrg_osc.TABLE_LANGUAGES' doesn't exist

select languages_id, directory from TABLE_LANGUAGES where code = ''

[TEP STOP]

 

Checked to make sure the table is there and sure enough... it is.

 

Anyone know where I can look to figure this one out?

 

Thanks in advance :thumbsup:

 

~Roq

Link to comment
Share on other sites

  • 1 month later...

Hello All,

 

I recently installed the newest version of the Edgeio feed. THe XML creates fine and looks correct.

 

I have set $dryrun=false; //whether or not execute actual upload to both or stop at file generation and ran the script.

 

Then I execute www.mysite.com/admin/rss_edgeio.php

 

The browser gives me the following message.

 

 

HTTP/1.0 200 OK Date: Wed, 05 Dec 2007 19:37:54 GMT Server: Apache/2.0.59 (Unix) Cache-Control: max-age=300 Expires: Wed, 05 Dec 2007 19:42:54 GMT Content-Type: text/xml X-Cache: MISS from www.edgeio.com X-Cache-Lookup: MISS from www.edgeio.com:80 Via: 1.0 www.edgeio.com:80 (squid/2.6.STABLE9) Connection: close faultCode1 faultStringExpected methodCall but got methodcall Edgeio File

 

Then only thing I can see is that it is expecting a capitol "C" in methodCall. It exits on faultCode1.

 

Has anyone else had this issue.

 

osCommerce RC1

PHP5

MYSQL5

 

 

-Jim

Link to comment
Share on other sites

I am getting error in includes/classes/seo.class.php on line 1057 and 1058.

 

Whats the edgeio code for seo.class.php ?

 

The xml file isn't being created. Dotster says that both feeds folder and rss_edgeio.php must be placed under webspace / httpdocs /

 

catalog is under webspace / webapps / osCommerce / httpdocs / catalog

Nina

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...