Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29
  1. #21
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Can I use an auto Import/cron job for this?

    sigh. Who's the hosting company?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #22
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    fusion-uk

  3. #23
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: Can I use an auto Import/cron job for this?

    Quote Originally Posted by KNM Computers View Post
    I have looked at your cron job settings and no command is entered. You may need to seek advice from the scripts publisher, they should offer setup support.
    Sounds like they have no idea what they're talking about.

    Quote Originally Posted by KNM Computers View Post
    am i suppose to put a command in the cron1.php file?
    the cron1.php file IS the command


    It's possible their server can't run PHP scripts via cron because their CLI (command-line-interface) version of PHP isn't properly configured.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #24
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    Quote Originally Posted by DrByte View Post
    Sounds like they have no idea what they're talking about.


    the cron1.php file IS the command


    It's possible their server can't run PHP scripts via cron because their CLI (command-line-interface) version of PHP isn't properly configured.
    ok this is what fusion uk say:

    We have checked and could see that the path which you have mentioned in the cron file was wrong.

    ==
    /home/username/plubic_html/admin/cron1.php
    ==

    We have corrected the path. Please check it now.

    ==
    root@srv9 [/home2/username/public_html/admin]# crontab -lu username
    MAILTO="[email protected]"
    0 * * * * php -q /home2/username/public_html/admin/cron1.php
    ==

    so i tryed that one and it didnt work so they say:

    The root access is disabled on our shared servers for security reasons.

    The root access is being called from a php file not the command line. We advise you to seek support from the script publisher.

    im begining to think they know nothing and im a noob

  5. #25
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    Quote Originally Posted by KNM Computers View Post
    ok this is what fusion uk say:

    We have checked and could see that the path which you have mentioned in the cron file was wrong.

    ==
    /home/username/plubic_html/admin/cron1.php
    ==

    We have corrected the path. Please check it now.

    ==
    root@srv9 [/home2/username/public_html/admin]# crontab -lu username
    MAILTO="[email protected]"
    0 * * * * php -q /home2/username/public_html/admin/cron1.php
    ==

    so i tryed that one and it didnt work so they say:

    The root access is disabled on our shared servers for security reasons.

    The root access is being called from a php file not the command line. We advise you to seek support from the script publisher.

    im begining to think they know nothing and im a noob
    they say they have amended it and should work but again it did not but i did get an email saying:

    no it did not work, this is the email it sent:

    <br />
    <b>Parse error</b>: syntax error, unexpected T_REQUIRE in <b>/home2/isername/public_html/admin/cron1.php</b> on line <b>3</b><br />

    the problem now is the script isint it?

  6. #26
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    its ok got it working i remade the cron1.php file and now works

    now just have to fight with the other script see if i can get that edited if any one knows how?
    Last edited by KNM Computers; 31 Jul 2013 at 01:03 PM.

  7. #27
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    Quote Originally Posted by KNM Computers View Post
    can anyone help please? with this script below

    1. can it be used for a cron job?

    2. at the top of it there a space to put url to fetch file can a user name and password be added to script for a passwored url? if so how do i do it?

    3. can i modify the script to over ride an image url so instead of importing the image url that come with the feed file it would use an image url of i choose? if so how do i implement it ?

    thankyou


    http://www.zen-cart.com/attachment.p...3&d=1209389792
    right if anyone has any idea on how to do the above 1,2 &3 on the script below your help would be greatfull

    Code:
    #!/usr/bin/perl
    # Be sure to rename this file with a .pl extension as it is a Perl Script.
    # Uses LWP to pull down a datafile, convert its format, save it to a temp location, 
    # and tell easypopulate.php to put the data into OSCommerce
    # If the update is correct, the froogle extract file will be downloaded
    # and ftp'd to google for processing
    # Orginally Written by Marty Bostick
    # Version 1.1.4
    
    use LWP;
    use LWP::UserAgent;
    use Net::FTP;
    
    ####################################################################################
    #                             User Defined Variables                               #
    ####################################################################################
    # URL to get 3 column file from
    # Note: The parsing routine can be customized to account for more than 3 columns
    #       But this script is used by me daily to update my quantities with that of my
    #       supplier.  This is very helpful when you are using a Dropshipper.
    # I also provide custom updates at reasonable prices for those interested.
    
    $sourceURL = 'http://SOMEVENDOR.COM/Restrict3d/datafile_3.csv';
    # Output File Name, output will be overwritten
    #$outputFile = "Output.txt";
    $outputFile = "/home/USERDIR/public_html/osc/temp/Output.txt";
    # 1 to use proxy, 0 to disable proxy, this is read from the HTTP_proxy env variable
    $useProxy = 0;
    # URL to call to load data
    $loadURL = 'http://MYSITE.COM/osc/admin/easypopulate.php?localfile=Output.txt';
    # Change the variables below to be your OSC or ZenCart Admin Username/Password
    $loadUserName = "OSCADMINUSERNAMEHERE";
    $loadPassword = "OSCADMINPASSWORDHERE";
    
    # If you want to, you can also upload your products to Froogle as I am below.
    # Froogle Information
    $froogleFeedURL = 'http://MYSITE.COM/osc/admin/easypopulate.php?download=stream&dltype=froogle';
    # Be sure to change the frooglefilename.txt to the one you have setup with Froogle.
    #$froogleFileName = "frooglefilename.txt";
    $froogleFileName = "/home/USERDIR/public_html/osc/temp/frooglefilename.txt";
    $froogleFtpSite = "hedwig.google.com";
    $froogleFtpPort = 21;
    # Set your Froogle Username/Password below
    $froogleUser = 'FROOGLEUSERNAME';
    $frooglePassword = "FROOGLEPASSWORD";
    
    ####################################################################################
    #                            End User Defined Variables                            #
    ####################################################################################
    
    print "Running Program at " . localtime() . "\n";
    
    #create the user agent that will make the HTTP calls
    $userAgent = LWP::UserAgent->new;
    $userAgent->agent("Qty Update Agent");
    
    # check to see if you need a proxy
    if($useProxy == 1){
        $userAgent->env_proxy;
    }
    
    $req = HTTP::Request->new(GET => $sourceURL);
    
    my $res = $userAgent->request($req);
    
    if ($res->is_success) {
        if(open(OUTPUTFILE, ">$outputFile")){
            print OUTPUTFILE "v_products_model\tv_products_quantity\tEOREOR\n";
            @dataArray = split('\r\n', $res->content);
            $length = @dataArray;
            for($i=1; $i<$length-1; $i++){
                $temp = $dataArray[$i];
                $temp =~ s/\"//g;
                @record = split(',', $temp);
                print OUTPUTFILE "$record[0]\t$record[2]\tEOREOR\n";
            }
            close(OUTPUTFILE);
            print "Successfully Created output file $outputFile \n";
        }
        else{
            print "Could not create output file $outputFile \n";
        }
    
        #call the webpage to load the data into oscommerce
        $loadRequest = HTTP::Request->new(GET => $loadURL);
        $loadRequest->authorization_basic($loadUserName, $loadPassword);
        $loadReponse = $userAgent->request($loadRequest);
        if($loadReponse->is_success){
            print "Successfully Updated Quanities\n";
        }
        else{
            print "Could not update quanities\n";
            print $loadReponse->status_line;
            print "\n";
        }
        
        # update froogle data, this can occur even if you cannot update quanaites on the site
        # but not if you cannot get the new quanities from the supplier
        $froogleRequest = HTTP::Request->new(GET => $froogleFeedURL);
        $froogleRequest->authorization_basic($loadUserName, $loadPassword);
        $froogleResponse = $userAgent->request($froogleRequest);
        if($froogleResponse->is_success){
            $createdFile = 0;
            if(open(FROOGLEFILE, ">$froogleFileName")){
            print FROOGLEFILE ($froogleResponse->content);
            close(FROOGLEFILE);
            $createdFile = 1;
            }
            else{
                print "Could not create froogle extract file, check permissions.\n";
            }
            if($createdFile == 1){
                $froogleFtp = Net::FTP->new("$froogleFtpSite", Port => $froogleFtpPort);
                $return = $froogleFtp->login("$froogleUser", "$frooglePassword");
                if($return != 1){
                    print "Could not Login to FTP Server $froogleFtpSite\n";
                }
                else{
                    $froogleFtp->ascii;
                    $return = $froogleFtp->put("$froogleFileName");
                    if($return eq ""){
                        print "Could not Upload file $froogleFileName\n";
                    }
                    else{
                        print "Successfully Uploaded Froogle Feed\n";
                    }
                }
                $froogleFtp->quit;
            }
    
    
        }
        else{
            print "Could not download the froogle extract\n";
        }
    }
    else {
        print "Could not contact source server $sourceURL\n";
        print $res->status_line;
        print "\n";
    }

  8. #28
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    right ok on the file above (autofeed) i added to this part:

    if ($res->is_success) {
    if(open(OUTPUTFILE, ">$outputFile")){
    print OUTPUTFILE "v_products_model\tv_products_quantity\tEOREOR\n";
    @dataArray = split('\r\n', $res->content);
    $length = @dataArray;
    for($i=1; $i<$length-1; $i++){
    $temp = $dataArray[$i];
    $temp =~ s/\"//g;
    @record = split(',', $temp);
    print OUTPUTFILE "$record[0]\t$record[2]\tEOREOR\n";
    }

    i added to this line print (OUTPUTFILE "v_products_model\tv_products_quantity\tEOREOR\n";)

    (v_products_model\tv_products_image\tv_products_name_1\tv_products_description_1 \tv_products_url_1\tv_products_price\tv_products_weight\tv_products_quantity\tv_ manufacturers_name\tv_categories_name_1\tv_categories_name_2\tv_categories_name_ 3\tEOREOR\n";)

    set up a cron job and got this email:

    Running Program at Wed Jul 31 18:48:02 2013
    Could not create output file
    /home/username/public_html/tempEP/Full-EP2013Jul20-2311.csv
    Successfully Updated Quanities
    Could not download the froogle extract

    did it not creat output file because i added all the extra bits?

  9. #29
    Join Date
    Apr 2011
    Location
    UK
    Posts
    54
    Plugin Contributions
    0

    Default Re: Can I use an auto Import/cron job for this?

    ok sorry all i got the script working, only it gave me my file with no products in and only one tab with all headings in file like this:

    v_products_model v_products_image v_products_name_1 v_products_description_1 v_products_url_1 v_products_price v_products_weight v_products_quantity v_manufacturers_name v_categories_name_1 v_categories_name_2 v_categories_name_3 EOREOR

    how do i correct this?

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. Admin auto login for a cron job
    By Gigo in forum Customization from the Admin
    Replies: 20
    Last Post: 9 Aug 2012, 07:39 AM
  2. Can I run Backup MYSQL Plugin v1.4 via cron job?
    By Renz in forum General Questions
    Replies: 2
    Last Post: 23 Mar 2012, 06:25 AM
  3. Setting up a cron job for the Snapshot add-on?
    By RescoCCC in forum All Other Contributions/Addons
    Replies: 11
    Last Post: 3 Jan 2012, 06:19 PM
  4. Cron Job for Optimize Database
    By Convergence in forum General Questions
    Replies: 4
    Last Post: 24 Jan 2011, 09:36 PM
  5. Cron Job for Updating QTY
    By ryanb4614 in forum General Questions
    Replies: 2
    Last Post: 9 Aug 2010, 07:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR