Updated: 8/14/2003; 1:22:01 AM.
Distressed Fabric
Mcgyver5's Radio Weblog
        

Tuesday, July 16, 2002

Whoa.  I got my brain back today after spending the last four days with some kind of African Sleeping Sickness.  I am messing around with PHP's cURL functions and building agents that surf the web by themselves.  I spent a few pathetic hours scratching around in regular expression land trying to extract all the links from any given website until I found the following one-liner.  It will take the URLs of all the links in a string called $result and stuff them into an array called $arrayoflinks:

preg_match_all("|href=\"?([^"' >]+)|i", $result,$arrayoflinks);

I posted the notes from our July PHP users group meeting about writing spiders.  It was one of our best meetings ever.  There a bunch of extroverted geniuses there this time and I learned a lot. 


5:44:38 PM    comment []


© Copyright 2003 mcgyver5.
 
July 2002
Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Jun   Aug

Frequent Visits
Categories

Click here to visit the Radio UserLand website.

Subscribe to "Distressed Fabric" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.