Results 1 to 11 of 11
  1. #1
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    Need a little help from the pros..thanks in advance
    I started a thread before but since I am new...I was told to come over here and try it since all the coders live over here....my new wanna be home.

    Here is the thread (hope I pasted this right)
    http://forum.abestweb.com/showthread...653#post918653

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

    I know it may seem lazy but as you all know...you only have so much time to learn new stuff. I am a vba guy. So although I could sit down and try to learn all the great stuff about php. I would rather use that time to make my site more "sticky" like so many of you talk about.

    What I need is the php code to just download through FTP as many merchants as I am approved for into there own text file. I have seen a few other threads here which tell how to do it..which is great...but they always includ code to import the info into a database like mysql which I am not using. So as you know taking piece of code out that you are not sure on in the first place is going to cause some errors and waste time. I am assuming a lot of pros could write it in several lines in 10 minutes what it would take me several hours to figure out.

    Currently I am downloading each .csv file by vendor number and my code imports those file into my database which works great. What is not so great is downloading each file one at a time. Thank in advance...and this is the best forum I have ever found.

  2. #2
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    England
    Posts
    4,327
    Have you tried using an ftp client? synchronize

  3. #3
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    WOW...Julian....your everywhere

    I don't know. I would assume all these feeds would have different address or maybe not. That would be cool to be able to hook up to the main server and click on all the feeds you want and download. But there has to be more than that.

  4. #4
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    I did find this by mobilebadboy

    $ftp_server = "datafeeds.shareasale.com"; // Do not change this
    $ftp_user_name = "user_name"; // Replace user_name with your SAS login name
    $ftp_user_pass = "user_pass"; // Replace user_pass with your SAS password
    $source_file = "/number/number.txt"; // Replace both number with the merchant ID
    $destination_file = "number.txt"; // Replace number with the Merchant ID
    $sasid = "sas_id"; // Replace sas_id with your SAS ID; Can be found at the top of any SAS page


    Which I understand thanks to his comments...but would you use a loop of merchant ids to them get several of them while changing the destination file...also I don't see anything to close the connection. Like I said on the other forum...I know vba but no clue on php. At least doesn't make me look like a complete idiot.

  5. #5
    ABW Ambassador
    Join Date
    January 18th, 2005
    Location
    England
    Posts
    4,327
    Quote Originally Posted by john the noob
    WOW...Julian....your everywhere

    I don't know. I would assume all these feeds would have different address or maybe not. That would be cool to be able to hook up to the main server and click on all the feeds you want and download. But there has to be more than that.
    This is a sub-forum of abestweb

    You can set up the ftp client for Shareasale, and choose to download the files that have changed since the last time you downloaded. Have them going to whatever folder on your computer.

  6. #6
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    Are you serious? That is incredible. My mind...I can't think....I am speechless and I will try it out thanks.

  7. #7
    .
    Join Date
    January 18th, 2005
    Posts
    2,973
    It never occurred to me that you aren't using an ftp client already. That is absolutely the quickest and most effective way to download datafeed files without using a script. (The ftp client should be running on the computer where you want the files downloaded; otherwise, you'd need to download all the files from ShareASale to your local computer, and then upload them to your server for import into your database.)

    However, I strongly recommend against simply "downloading everything" because the ShareASale merchant folders each contain three versions of each datafeed, but you only need one! Choose which file format you'll download (txt or one of the compressed formats) and only download that version.

    Also, be aware that you must specially request ftp access from each merchant (and some ignore or decline those requests). When a merchant "approves" you as an affiliate, you have immediate access to manually download datafeeds, but you do not have ftp access until you request it (using the SAS online form). For merchants who don't grant ftp access, you'll have to choose whether to manually download their datafeeds or simply exclude those merchants (they usually aren't your best-quality merchants).

    Another tip: be careful not to enable "keep-alive" in the FTP client (it might be enabled by default), because if you keep open your FTP sessions longer than reasonably necessary, ShareASale will block your FTP access.

    Finally: When posting messages on a discussion forum, use a message title that describes what you are asking about. If either of your posts had used a title like "Need help with automating datafeed downloads" or something similar, you might have received a useful response much quicker.
    Last edited by markwelch; March 4th, 2009 at 03:34 PM.

  8. #8
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    "When posting messages on a discussion forum, use a message title that describes what you are asking about"

    Thanks for the info...I hardly post on any forum so I am kinda of the noob.

    thanks for the additional information in regards to the FTP. I feel really dumb...but I just assumed it was private or something....I don't know. I still feel even though that would work....a script would be better in the long run when you have many merchants. I guess where I am confuse on the above script is that does php have loop statements so I can open the connection above and keep changing the file to request and the destination file. Also....where is the close statement for the connection.

    Thanks for all the information provided so far....again Mark...anything you are stuck on still just let me know and I will try to tell how I would attack the problem.

  9. #9
    Roll Tide mobilebadboy's Avatar
    Join Date
    January 18th, 2005
    Location
    Mobile, Alabama
    Posts
    1,220
    Hate to stray you from your visual basic, but php/mysql is where the attention goes when it comes to web dev, it's just the popular choice. That's what most people use. It's either learn it or find some good VB people, which I don't know any. Not saying there aren't alternatives, people just flock to php/mysql.

    I used to write non-web VB scripts (simple computer-based scripts) years ago, if you know coding you can learn coding. It just takes a little time and a little reading.

    For PHP, I would look at FTP, arrays, while and foreach.

    I assume you know what an array is: array = "1", "2", "3", "4"

    while is a begin and end.

    while { this is happening do this }

    foreach is similar:

    foreach ( x as y ) { do this }

    You want to download several merchant files by ftp?

    Try this (directory must be writable):

    PHP Code:
    <?
    $ftp_server 
    "datafeeds.shareasale.com"// Do not change this 
    $ftp_user_name "user_name"// Replace user_name with your SAS login name 
    $ftp_user_pass "user_pass"// Replace user_pass with your SAS password 
    $sasid "sas_id"// Replace sas_id with your SAS ID; Can be found at the top of any SAS page

    //replace each with merchant id
    $merchants = array("0000""1111""2222");

    foreach(
    $merchants as $merchant) {

    $conn_id ftp_connect($ftp_server);  
    $login_result ftp_login($conn_id$ftp_user_name$ftp_user_pass);  

    if ((!
    $conn_id) || (!$login_result)) {  
         echo 
    "FTP connection has failed to $ftp_server as $ftp_user_name.<br />"
         exit;  
    } else { 
         echo 
    "Connected to $ftp_server successfully as $ftp_user_name.<br />"


    $download ftp_get($conn_id$merchant.".txt""/".$merchant."/".$merchant.".txt"FTP_ASCII);  

    if (!
    $download) {  
         echo 
    "FTP download has failed!"
    } else { 
         echo 
    "Downloaded ".$merchant."/".$merchant.".txt from ".$ftp_server." as ".$merchant.".txt"


    ftp_close($conn_id); 
    }
    ?>

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

  10. #10
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    Mobilebadboy....I am in your debt. I have read so many of your post and I really wanted to ask you but I felt I had no right to. Thank you so much....I love this forum...way better than any school or book. I will learn PHP, but as you all know you can spend hours or even days on trying to figure out some coding to the point you want to throw your computer out the window and then someone goes...just add this statement. Again...thanks and have a great week.

  11. #11
    Newbie
    Join Date
    January 27th, 2009
    Posts
    19
    Also want to say thanks to julian for directing me over here. I feel like a kid at Christmas. Hey...with the world falling apart and everyone is depressed in regards to the present and future...it is nice to be happy once in awhile.

  12. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Featured: Question for WP pros...
    By BOOBOOCH5 in forum Blogging, Mobile and Social Media
    Replies: 13
    Last Post: February 16th, 2015, 10:12 AM
  2. Need a little help...thanks in advance
    By john the noob in forum ShareASale - SAS
    Replies: 14
    Last Post: March 4th, 2009, 04:34 PM
  3. A question for the pros.
    By karomesis in forum Midnight Cafe'
    Replies: 13
    Last Post: September 10th, 2006, 11:35 PM
  4. Looking for pros and cons
    By Airstrip in forum Commission Junction - CJ
    Replies: 0
    Last Post: December 19th, 2004, 10:00 AM

Posting Permissions

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