473,396 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Lynx and wget - redirect problems for PHP scripts

I have a PHP script that should be run a few times a day. Currently I run
this script manually as I haven't been able to set up Lynx or wget to run it
as a cronjob. Or to be more specific: the script works, but both wget and
Lynx fail after 10 or 20 redirects, then it warns:

wget: 20 redirections exceeded.
Lynx: Alert!: Redirection limit of 10 URL's reached.

What the scripts does is download various HTML pages (allowed by the
owners) - and some of them have 20-100 pages. The script loops through the
pages and for each new does a redirect. After 10 or 20 it is stopped, due to
Lynx and wget.

Any idea how to fix this ? Can the 10 or 20 limits be modified ?

Martin.
Jul 16 '05 #1
3 8145
Hi Martin!

On Wed, 10 Sep 2003 22:31:22 +0200, "Martin" <ma****@home.se> wrote:
I have a PHP script that should be run a few times a day. Currently I run
this script manually as I haven't been able to set up Lynx or wget to run it
as a cronjob. Or to be more specific: the script works, but both wget and
Lynx fail after 10 or 20 redirects, then it warns:

wget: 20 redirections exceeded.
Lynx: Alert!: Redirection limit of 10 URL's reached.

What the scripts does is download various HTML pages (allowed by the
owners) - and some of them have 20-100 pages. The script loops through the
pages and for each new does a redirect. After 10 or 20 it is stopped, due to
Lynx and wget.

Any idea how to fix this ? Can the 10 or 20 limits be modified ?


Maybe ask this question in comp.os.linux.apps, but maybe you can
modify your script, so that it keeps a database table of pages to
download. Then call it every minute and stop it after 55 seconds. This
way, you don't need redirects and its also more reliable towards slow
connection from the sites you download from.

HTH, Jochen
--
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #2
"Martin" <ma****@home.se> wrote in message
news:<yS*****************@news2.bredband.com>...

wget: 20 redirections exceeded.

Any idea how to fix this ? Can the 10 or 20 limits be modified ?


wget seems to have this limit hard-coded in retr.c:

/* Maximum number of allowed redirections. 20 was chosen as a
"reasonable" value, which is low enough to not cause havoc, yet
high enough to guarantee that normal retrievals will not be hurt by
the check. */

#define MAX_REDIRECTIONS 20

Cheers,
NC
Jul 16 '05 #3
Thanks guys - appreciate your help.

Martin.

"Martin" <ma****@home.se> wrote in message
news:yS*****************@news2.bredband.com...
I have a PHP script that should be run a few times a day. Currently I run
this script manually as I haven't been able to set up Lynx or wget to run it as a cronjob. Or to be more specific: the script works, but both wget and
Lynx fail after 10 or 20 redirects, then it warns:

wget: 20 redirections exceeded.
Lynx: Alert!: Redirection limit of 10 URL's reached.

What the scripts does is download various HTML pages (allowed by the
owners) - and some of them have 20-100 pages. The script loops through the
pages and for each new does a redirect. After 10 or 20 it is stopped, due to Lynx and wget.

Any idea how to fix this ? Can the 10 or 20 limits be modified ?

Martin.

Jul 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Damo | last post by:
Could someone please help me. I am a newbie at PHP. I downloaded formail.php Version 5.0 from Jacks scripts( http://www.dtheatre.com/scripts/ )and changed the required areas to my email address and...
1
by: LRW | last post by:
In a PHP script I have the following two lines: $thumbproc = escapeshellcmd("wget -q -T 2000 http://(A URL)/pa-thumbs/createthumbs.php?dir=".$order_po." &"); exec("$thumbproc 2>&1", $output); ...
7
by: Ken | last post by:
How do I call c:\wget\wget.exe from a php or html file? so I can use php variables to define the file names to download. I want to set up wget to download several files from a server to my hard...
3
by: Lacustral | last post by:
I'm using the Lynx browser - it doesn't handle Javascript, it gives me a message "unsupported URL scheme". I don't have a PC, I have a text-only terminal. Is it possible to make a kluge to get...
1
by: Remulac | last post by:
I am in the process of getting ASCII data down from a server that will print out the ASCII version of a proprietary format when you click "get ASCII" on the site. I'm trying to bring it down...
7
by: petr pilsl | last post by:
sorry - no idea where to post my question, so I crossposted to a linux and a html-authoring-group. Both groups might be familiar with wget. wget -p http://www.goldfisch.at does not load the...
21
by: John | last post by:
Hi, I updated a site and changed the file extensions from .html to .php. Now i noticed that the google does find the old .html pages but since they're not there anymore... they can't be found....
3
by: Jesse | last post by:
Hi all, I have a problem using wget and Popen. I hope someone can help. -- Problem -- I want to use the command: wget -nv -O "dir/cpan.txt" "http://search.cpan.org" and capture all it's...
2
by: Don69 | last post by:
I have a problem with PHP where wget generates 0 byte files. Below is the code that I use. // ******************** $savedir = "/webroot/vifs/app/webroot/static/1234567890"; $url =...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.