Unable to use sasftp script on csn datafeed


View the full Thread by clicking here


Sharan
July 23rd, 2008, 11:47 AM
I have been trying to use an ftp script to automatically download the CSN datafeed and enter it into my database. I have tried the full feed and then several of the store feeds with no luck.

I have ftp access privilege and can use my regular ftp program to download the files. I am able to use the ftp script to automatically download other SAS feeds, but not CSN. Is there something special that I need to do to be able to use the script? Maybe some extra code or change the code?

I would like to start promoting the CSN stores more so I'm hoping someone has some ideas for me about using the automatic ftp script.

Sharan

Brent E.
July 23rd, 2008, 11:51 AM
Hi Sharan,

Thanks for the post. I do not know why this would be happening to you. I have already sent this message to the SAS support team to look into. I will let you know what we come up with.

Thanks,

Brent

Sharan
July 23rd, 2008, 11:57 AM
Thanks Brent for the quick reply.

Hopefully it is just something little that I am doing wrong and can be fixed soon.

Sharan

Brent E.
July 23rd, 2008, 12:06 PM
Hopefully it is just something little that I am doing wrong and can be fixed soon.

That would be sweet! We'll see. Is anyone else out there seeing this same issue?

Thanks,

Brent

SeymourButts
July 23rd, 2008, 12:23 PM
I haven't seen the CSN datafeed, but could the problem be related to size of the file?

Sharan
July 23rd, 2008, 12:40 PM
I haven't seen the CSN datafeed, but could the problem be related to size of the file?

That might be true if I was trying to just download the CSN datafeed, but I have also tried one of the individual CSN store feeds which is much smaller. I just get the message:
FTP download has failed! Script will end.

Sharan

SeymourButts
July 23rd, 2008, 12:41 PM
And I assume you have been a)given ftp access to the feed by CSN and b)able to ftp other merchant files?

Sharan
July 23rd, 2008, 12:46 PM
And I assume you have been a)given ftp access to the feed by CSN and
b)able to ftp other merchant files?

Correct - I have had no trouble (so far) using the script on the other merchants feeds/files I have been given ftp access to.

Sharan

writerguy
July 23rd, 2008, 12:52 PM
Hi Sharan. Don't know what script you're using, but I have one that works. The single issue I found when doing CSN datafeeds with the script I use is that I forgot to add the number for the specific datafeed file I wanted to download in one spot in the script. I had put "11035.txt" in one of the two locations where I needed the df number, and it should have been "11035-43.txt"

Could it be something that simple?

BTW -- Let me know and I'd be happy to send you a copy of the PHP script I use to download one of the CSN scripts and put it into a table on my server. (It's simply a modified version of the one "mobilebadboy" and others put together in an old thread on the Datafeed forum.)

Brent E.
July 23rd, 2008, 01:01 PM
Thanks to everyone pitching in to help Sharan with this issue. I love the support ABW members lend each other.

Keep up the great work!

Brent

Sharan
July 23rd, 2008, 01:02 PM
BTW -- Let me know and I'd be happy to send you a copy of the PHP script I use to download one of the CSN scripts and put it into a table on my server. (It's simply a modified version of the one "mobilebadboy" and others put together in an old thread on the Datafeed forum.)

The script by "mobilebadboy" is the one I have been using and although I have only used it on a few of the merchants that I have ftp access for, I have had no trouble getting it to work.

Would love to have a copy of the modified PHP script you use and see if it will work.

Sharan

p.s. this time I used the quote reference and not the code reference I used on the last few posts I made :bonk:

writerguy
July 23rd, 2008, 01:26 PM
Sharan, I just emailed you a copy of that script. Hope it's useful to you.

Sharan
July 23rd, 2008, 01:32 PM
Gary,

I just received it and am looking it over now -- I'll let you know.

Thanks,
Sharan

lostdeviant
July 23rd, 2008, 05:49 PM
I just tried it and it really is simple

The import script looks for /merchid/merchid.txt for the file, so as soon as you put in a csn store number it will break because it will look for the file in /11035-1/11035-1

the merchnumber-1 directory doesn't exist so it won't find the file. Replace the variable for the merchant at that point in the script and it will work.

Also make sure the store name doesn't include odd characters or spaces.

Sharan
July 23rd, 2008, 06:32 PM
Thanks for all the help.

I did get a modified script to work -- at least it downloaded it and put it into the databased, however it left the table named xxx_temp (xxx obviously being my table name which I x'd out.

Maybe a little more checking and tweaking and I'll get it to work.

When you know just enough to be dangerous -- look out world.

Sharan

writerguy
July 23rd, 2008, 06:47 PM
When you know just enough to be dangerous -- look out world.

Sharan

Exactly why I'm not as much help as I'd like to be with PHP/MySQL/WordPress stuff. I know just enough of each to be in that dangerous category. :D

lostdeviant
July 23rd, 2008, 06:53 PM
it sounds like you changed the import script in more than one place.

you should only change the directory where it looks for the file. Don't change variables anywhere else.

Sharan
July 23rd, 2008, 07:28 PM
it sounds like you changed the import script in more than one place.

you should only change the directory where it looks for the file. Don't change variables anywhere else.

Which script are you using? At first I was trying to use the one that I downloaded from mobilebadboy's site that uses forms, but it only called for a merchantId and that's the one I couldn't get to work.

Then I used the one posted here:
http://forum.abestweb.com/showthread.php?t=86606&page=3&pp=25
plus a few modifications that Gary had given me. Like I said it worked except it left it in the temp table.

Sharan

lostdeviant
July 23rd, 2008, 09:43 PM
Why don't you post the section of code you changed?

You should only change the place in the code where it tries to download the csv where you see /merchantid/merchantid.txt and set the directory to their merchant number.

Sharan
July 23rd, 2008, 10:59 PM
Well, all righty then --

I just made a couple of tweaks to the part that had been modified and ran the script again -- it worked the way it was supposed to and the table no longer says temp. :clap:

Again, thanks to all who offered help and suggestions. Team-work will pull the wagon every time.

Sharan

Brent E.
July 24th, 2008, 11:33 AM
Seymour Butts, Lost Deviant and Writer Guy,

Thank You! Thank You! Thank You! I really appreciate you guys taking the time out to help Sharan with this issue. It is a testament of your willingness to help a complete stranger, and competitor. Well done! That is what I like to call "Good Karma"!

Have a great day and thanks again!

Brent

writerguy
July 24th, 2008, 12:06 PM
Hey, you're entirely welcome.

I dunno about "good karma," but I do know the folks here at ABW have been good, and very helpful "online friends" to me, so it's always a pleasure to try when I can.

AND -- I've got a major part of one of my websites set up using a pagination script Sharan helped me figure out on another thread here, so I'm very glad to help out if I can! LOL!

lostdeviant
July 28th, 2008, 08:00 AM
I had only recently added CSN to my database and was able to do so with the change I mentioned earlier however I noticed another problem. My script currently searches for the merchant id of the csn store (as configured in the script like "11045-14") and deletes that from the "big" table where there are all the merchants together before adding the csv's content. This makes sure the content doesn't duplicate. Unfortunately when I look at a CSN store in Phpmyadmin it doesn't show its full ID in MerchantID, instead it only shows the general CSN ID, so I'd like to know how I can EASILY delete those old entries and therefore avoid bloating my big database with duplicate entries from CSN stores.
This isn't an issue with the one table per store since the script can drop and recreate the individual store table.

of course what I'd really like is to have the "small" csv datafeeds created with their IDs in the merchantID and then there would be no problem to fix.

Brent E.
August 1st, 2008, 05:56 PM
Hi Lost Deviant,

I was not able to answer your question, but the good folks at SAS helped us out. Here is their solution below.

My first suggestion would be to create an additional column in my "big table" for the store ID value. I can insert this when I upload each file, and then delete on both the merchantID and storeID columns in my update script. He seems to indicate that his ideal solution is to have the merchantIDs listed as 11035-[StoreID], which he could certainly do on his end when he inserted each file. That is not a change we could make on our end, though, as the merchantID column in the datafeed has a specific meaning, and the proper value for your account is 11035. Hope that helps.

Is that a reasonable solution to the issue you were having?

Thanks,

Brent

lostdeviant
August 1st, 2008, 06:11 PM
Brent,

I'd rather not make a new database table column just to get CSN Store feeds to work right with my current system.

Hopefully someone will see the light and have the correct merchant ID in the individual store feeds.



Hi Lost Deviant,

I was not able to answer your question, but the good folks at SAS helped us out. Here is their solution below.

My first suggestion would be to create an additional column in my "big table" for the store ID value. I can insert this when I upload each file, and then delete on both the merchantID and storeID columns in my update script. He seems to indicate that his ideal solution is to have the merchantIDs listed as 11035-[StoreID], which he could certainly do on his end when he inserted each file. That is not a change we could make on our end, though, as the merchantID column in the datafeed has a specific meaning, and the proper value for your account is 11035. Hope that helps.

Is that a reasonable solution to the issue you were having?

Thanks,

Brent

        
ABestWeb Affiliate Marketing Forum
 TOP
Copyright (C) 2001 - , ABestWeb - All World Wide Rights Reserved
Trademarks are property of their respective owners
Content may not republished, in any manner, without prior written permission

ABestWeb Affiliate Marketing Forum