Page 1 of 2 12 LastLast
Results 1 to 25 of 37
  1. #1
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    SAS/FTP Datafeed Import Script
    I decided to start a new thread since the other one got kind of lengthy plus I've created an entirely new version of the script, so questions for the new one can be asked here.

    What's new?
    No code editing. Simply fill in a few boxes and you're set.
    One file for all feeds. Instead of a file for each feed or editing one file for different feeds, as long as you change the merchant ID and table names, you can use this one over and over for multiple feeds.

    Downsides?
    If you use the old script with cron jobs, you'll want to stick to it. This one is form based.
    No information is stored, so manually filling in the information is required each run.

    I intended to have the sas/db info stored, but I know some might be uncomfortable with that. In the future I may add that feature in, with the option of having it stored or not (opting to input it manually each time).

    So I can always keep it updated, the script can be found here: http://shawnkerr.com/sasftp/

    Even if the page gets moved for some reason, that URL will still get you to it so it's the only one to remember/save if you decide to.

    Shawn Kerr (.com) | Disney World | SEC Football

  2. #2
    Beachy Bill's Avatar
    Join Date
    November 20th, 2005
    Posts
    8,266
    Shawn, this looks awesome.

    I have been working my way through the "older" thread because I have gotten to the point where I need this functionality. I had been downloading datasets to my computer, making adjustments and then uploading to my database(s) - with all sorts of related glitches.

    I just downloaded the zip fle and looked through the code. I must have learned something after all the time I spent in the other thread, because I can follow the script you wrote. I will be giving it a try later on tonight.

    Thank you for your generous contributions to the ABW crew, especially to some of us "code-challenged" individuals.

    Bill / Marketing Blog @ 12PM - Current project: Resurrecting my "baby" at South Baltimore..
    Cute Personal Checks and Business Checks
    If you are too busy to laugh you are too busy.

  3. #3
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Nice work Shawn and very generous. Your first thread inspired me to add direct ftp intake to my own scripts for SAS. I'm slowing converting everything to PHP5 and MySql5.

  4. #4
    Affiliate Manager
    Join Date
    January 18th, 2005
    Posts
    1,056
    Shawn,

    Great script and what a time saver!

    No information is stored, so manually filling in the information is required each run.
    One thing people can do if they want their info stored is just add a value in the form fields that they don't want to keep typing in...

    Example:

    Code:
     <td width="150">Shareasale Username:</td>
         <td width="170"><input type="text" name="sas_user" size="20" value="MYUSERNAME"/></td>
    Of course be sure to put this script in a directory that you can password protect.

  5. #5
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    The script has been updated. I added all of the new SAS fields to 2 parts of the script, but forgot the third. That's what I get for working til after daylight and being dead tired.

    Shawn Kerr (.com) | Disney World | SEC Football

  6. #6
    Affiliate Manager
    Join Date
    January 18th, 2005
    Posts
    1,056
    Got this error...

    Datafeed could not be imported: Column count doesn't match value count at row 1

  7. #7
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Sorry about that. One stinking little missing comma.

    I just tested it on a feed and all worked fine now for me.

    Shawn Kerr (.com) | Disney World | SEC Football

  8. #8
    Affiliate Manager
    Join Date
    January 18th, 2005
    Posts
    1,056
    Yep, working fine

  9. #9
    Beachy Bill's Avatar
    Join Date
    November 20th, 2005
    Posts
    8,266
    Shawn - works perfectly. Thanks. This is a great time-saver and you are very generous to share.

    Where can I buy you dinner?
    Bill / Marketing Blog @ 12PM - Current project: Resurrecting my "baby" at South Baltimore..
    Cute Personal Checks and Business Checks
    If you are too busy to laugh you are too busy.

  10. #10
    AM Navigator Geno Prussakov's Avatar
    Join Date
    May 10th, 2005
    Location
    Washington D.C. Metro Area
    Posts
    11,798
    Whew..... I love it!! Kudos to you, Shawn, and thank you!!

    Geno

  11. #11
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Quote Originally Posted by Beachy
    Where can I buy you dinner?
    As long as you find it useful and it helps you out, then that's all I need.

    Shawn Kerr (.com) | Disney World | SEC Football

  12. #12
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    I just tried the script and it stops here.....

    All fields are set - executing script...

    Attempting to make FTP connection...

    Connected to datafeeds.shareasale.com successfully as xxxxxxxx.

    Attempting to download datafeed...

    FTP download has failed! Script will end.

  13. #13
    Beachy Bill's Avatar
    Join Date
    November 20th, 2005
    Posts
    8,266
    Quote Originally Posted by SeymourButts
    ...Attempting to download datafeed...
    FTP download has failed! Script will end.
    I had that on the second domain where I installed it. Check your directory permissions - I had forgotten to make the directory writeable by all.

    Then on another domain I did not have the correct permissions for the "user." My original user was set to "select" only - so I changed it to "all" permissions. However, that did not seem to work because the "user" still retained the "select" permissions only. So I just created a "newuser" with "all" permissions - and it worked fine after that.

    This script really does work slick. It is a great timesaver.
    Bill / Marketing Blog @ 12PM - Current project: Resurrecting my "baby" at South Baltimore..
    Cute Personal Checks and Business Checks
    If you are too busy to laugh you are too busy.

  14. #14
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    I figured it was a write problem, but if I add write permission to the folder, the script will not load and goes to a custom error page.

  15. #15
    Affiliate Manager Alan Hamilton's Avatar
    Join Date
    March 13th, 2006
    Location
    Colorado / Florida
    Posts
    4,411
    Shawn,

    I'll tell ya lad, for a Bama fan, you're alright!! What you've done here is a great example of what a "positive" forum of industry peers is all about. That you would take the time to do this script, and then share it with others for their time (and mental) benefit is to be appreciated and applauded. Thank you for your effort and generosity.
    Join the Spicy Aprons Affiliate program on ShareASale Visit us on Facebook www.facebook.com/spicyaprons Follow us on Twitter @Spicyaprons

  16. #16
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    Host Gator is telling me that I am not able to get write access from the web under any circumstances, even if the folder is password protected. Permissions of 777 are not allowed. I somewhat understand why, but WTF!

  17. #17
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    I guess it's not a permission problem.

  18. #18
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    My Bad. I didn't realize you have to be approved to ftp datafeeds.

  19. #19
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    Thanks for the script MBB.

    I have modified it to ftp a list of datafeed files, currently it is getting 25, and then throwing each of those files into a single database table.

  20. #20
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    MySQL Indexes
    I was doing some reading on MySQL indexes tonight and remembered that there hadn't been any mention of that in Shawn's 2 very popular threads. At least that's what I'm thinking. They can really give your queries a noticeable speed boost.

    Indexes would really depend on the way your script is written so I guess Shawn couldn't put a one size fits all in his offering.

    Here is what I was reading. How MySQL Uses Indexes Could be everyone has crossed this bridge, but you never know.


  21. #21
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    indexes are a must for any decent sized database. When you have multiples tables also start looking at primary and foreign keys for data integrity. Once you have these topics and database normalization down you can boast about your mad crazy database skillz
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  22. #22
    Newbie
    Join Date
    May 23rd, 2005
    Posts
    21
    I'm new to the forum but not affiliate marketing. I've been selling via affiliate marketing and a few stores for about 6 years. I just recently started to learn php because I got sick of using getafreelancer and having someone quit on me in mid project, add to the cost because of things they didn't know,ect.

    I've been playing with this great script and see a tremendous value in it. I have been trying to set it up so the merchant id's can be put in a comma seperated array and use a foreach() function to import many merchants at the same time. This would be useful for creating themed datafeed sites (pets, vitamins, apparel, ect) and keeping them updated. Does anyone know where I should start the foreach() statement and how to use it. I've never done it before and wanted to know if anyone had any insight into this. http://us2.php.net/foreach
    Anyone? ... Anyone? .... Bueller ..... Bueller ....... Bueller .........

  23. #23
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    What have you tried so far and where is it failing?
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  24. #24
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    mcouvillon,

    Sorry I don't have an immediate answer, but this is on my 'think about it' list. I'm trying to figure out how to keep the simple functionality on the user end but really make it more robust.

    My biggest problem is finding the time to work on it, too busy killing myself trying to keep a roof over my head. But I do have ideas for this thing...

    The way the script sits now, it would take a few edits. It would be easier if I wasn't trying to be fancy with all the visual output. :| In theory, you could explode the merchid field right after the execute comment, run your foreach....Then close the foreach just before the time/microtime stuff at the bottom. It should just print out the same visual junk one after the other for each merchant.

    Just figure out your delimiter, and in then in the merchant id field do 0001,0002,0003 or 0001|0002|0003.

    But I could also be way wrong. This was just a quick thought.

    The script is in the middle of some code alterations I started and didn't finish at the time, so I can't do any quick testing right now.

    Shawn Kerr (.com) | Disney World | SEC Football

  25. #25
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    Another way to do it is to keep that merchant information in table and just loop through it. That would set you up for some long term possibilities - like putting information in your table about how often the feed is updated. That way you are not getting every feed every day. You can also put the merchant name in there. All kinds of possibilities!
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. How to FTP and Import SAS datafeeds
    By mobilebadboy in forum Programming / Datafeeds / Tools
    Replies: 180
    Last Post: August 21st, 2011, 03:34 AM
  2. Need Programmer for FTP script, datafeed import script
    By markwelch in forum Programming / Datafeeds / Tools
    Replies: 10
    Last Post: April 20th, 2007, 02:16 PM
  3. Need Programmer for FTP script, datafeed import script
    By markwelch in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: March 5th, 2007, 04:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •