PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 25th, 2000, 05:19 AM
jochum jochum is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: In nederland
Posts: 41 jochum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 2 sec
Reputation Power: 14
I would like to make a php3 file being visited every minute.
The php3 file is done
The cron file is not the problem.
Making a perl.cgi visiting the php3 file is.
I know about php3-cgi or lynx, but both sollutions aren't 'nice', every minute starting lynx neh. php3-cgi is being removed. I know I am not the only one with this problem, but it seems I cannot find the solution.
greeting Jochum

Reply With Quote
  #2  
Old May 3rd, 2000, 10:52 PM
esconsult esconsult is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 43 esconsult User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 14
You have to do some pretty smart Perl socket programming there. Check out Graham Barr's Net Libraries at CPAN, there is some functionality that should be able to help you retrieve a web page (your PHP script).

So you can cron a perl script...

------------------
PHP, Perl, SQL Programming at http://www.mentalobjects.com

Reply With Quote
  #3  
Old May 4th, 2000, 03:57 AM
jochum jochum is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: In nederland
Posts: 41 jochum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 2 sec
Reputation Power: 14
Ok, I found the answer, at least it works on my server.
You need to install some perl modules. Thanx to the one sending me the code. Forgot his name lost his mail.
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
#!/usr/bin/perl

my $url = shift;
$url = URI::URL::url($url, "http://somehost/somephppage")->abs;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
use MIME::Base64;
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request('GET', $url);
my $res = $ua->request($request);
my $result = ($res->is_success)?$res->content:$res->error_as_HTML;
$result = $1 if $result =~ /<BODY.*?>(.*?)</BODY>/si;
$result =~ s/(<IMG.*?SRC="?)(.*?)([" >])/$1.URI::URL::url($2, $url)->abs.$3/gies;
$result =~ s/(<A.*?HREF="?)(.*?)([" >])/$1.URI::URL::url($2, $url)->abs.$3/gies;
[/code]

Reply With Quote
  #4  
Old May 4th, 2000, 04:29 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Have you read this one I posted? http://www.devshed.com/Talk/Forums/Forum6/HTML/000136.html
Well, as long as you got yours running, that is fine.

Reply With Quote
  #5  
Old May 4th, 2000, 04:35 AM
jochum jochum is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: In nederland
Posts: 41 jochum User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 2 sec
Reputation Power: 14
yes I did, but I had some problems with the write permissions, nevertheless I am sure that one works fine

Reply With Quote
  #6  
Old May 4th, 2000, 05:12 AM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
My bad. I shouldn't use /tmp directory as an example.
$local_dir = "/tmp/grabbed_data";

If you hack the Simple.pm further, you will see $modified_time gives you a value under =item head($url).

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > cron->perl->php3 need help on the perl part.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap