Sensei
- Join Date:
- Jan 2004
- Posts:
- 63,513
- Plugin Contributions:
- 176
Can I use an auto Import/cron job for this?
sigh. Who's the hosting company?
Views: 6,492
Sensei
sigh. Who's the hosting company?
New Zenner
fusion-uk
Sensei
KNM Computers:
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.
KNM Computers:
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.
New Zenner
DrByte:
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.
We have corrected the path. Please check it now.
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
New Zenner
KNM Computers:
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.phpWe 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.phpso 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?
New Zenner
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?
New Zenner
KNM Computers:
can anyone help please? with this script below
can it be used for a cron job?
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?
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.php?attachmentid=3863&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
#!/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";
}
New Zenner
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?
New Zenner
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?
Tell staff why this post should be reviewed.