AOA AOA AOA Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!

Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 20th December, 2002, 08:42 PM
SiGmA_X's Avatar
Member
 
Join Date: April 2002
Location: Portland, OR
Posts: 1,529
Send a message via ICQ to SiGmA_X Send a message via AIM to SiGmA_X Send a message via MSN to SiGmA_X Send a message via Yahoo to SiGmA_X

Using PHP to Parse HTML

The subject says it all: I want to parse a HTML file using PHP... I was thinking about how to do this, and got quite stuck.

The file that I need to parse is a F@H User page (Ex. http://folding.stanford.edu/cgi-bin/...ame=AOA_Oregon)

I need to get the 'Active processors' info out of it... The HTML for that reads '<TR align=left><TD align=left><b>Active processors (within a week)</b></TD><TD align=left><font size=4>2 </font></TD></TR>'

If someone can help parse this for me, thank you a lot!

I'll be online quite a bit in the coming break, so if you want to talk to me either PM me, drop me an email (sigma@th3sp0t.com) or AIM/ICQ/etc me

Thank you all in advance!
__________________
"In war, it is not the goal to die for your country, but rather to make the other bastard die for his!"
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 9th January, 2003, 10:36 AM
cloasters's Avatar
Asst. BBS Administrator
 
Join Date: September 2001
Location: Location, Location
Posts: 16,113

Bump City.
__________________
When the world was better.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 6th February, 2003, 09:20 PM
sheepgoat's Avatar
Member
 
Join Date: June 2002
Posts: 31
Send a message via AIM to sheepgoat

here's my attempt. the script works, but it is slow. its mainly slow because http://folding.stanford.edu/cgi-bin...name=AOA_Oregon is slow. here's the code

PHP Code:
<?
$processors 
"";
$found 0;
$file file("http://folding.stanford.edu/cgi-bin/userpage.detailed?name=AOA_Oregon""r");
while((list(
$num$line) = each($file)) && $found == 0) {
   
$noTags strip_tags($line);
   if(
preg_match("/active processors/i"$noTags)) {
      if(
preg_match("/([0-9]+)/"$noTags$m)) {
         
$processors $m[0];
         
$found 1;
      }
   }
}

echo 
"Active Processors: ".$processors."<br />";
?>
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10th February, 2003, 01:50 PM
SiGmA_X's Avatar
Member
 
Join Date: April 2002
Location: Portland, OR
Posts: 1,529
Send a message via ICQ to SiGmA_X Send a message via AIM to SiGmA_X Send a message via MSN to SiGmA_X Send a message via Yahoo to SiGmA_X

Ah, thanks! Now I understand how to parse tags and search them for something. Thanks a lot

Are you ever on AIM anymore?
__________________
"In war, it is not the goal to die for your country, but rather to make the other bastard die for his!"
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 10th February, 2003, 04:15 PM
sheepgoat's Avatar
Member
 
Join Date: June 2002
Posts: 31
Send a message via AIM to sheepgoat

yeah, i'm always on. i think i may have changed screen names, which is booboospankyeyes.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 11th February, 2003, 09:41 PM
SiGmA_X's Avatar
Member
 
Join Date: April 2002
Location: Portland, OR
Posts: 1,529
Send a message via ICQ to SiGmA_X Send a message via AIM to SiGmA_X Send a message via MSN to SiGmA_X Send a message via Yahoo to SiGmA_X

That's the problem Talk to you there some time
__________________
"In war, it is not the goal to die for your country, but rather to make the other bastard die for his!"
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Html? ajopz Random Nonsense! 5 11th March, 2006 10:30 AM
Web site and Html Bull Programming and Assembly Language 3 13th October, 2002 02:39 PM


All times are GMT -5. The time now is 12:20 AM.


Copyright ©2001 - 2009, AOA Forums

Search Engine Friendly URLs by vBSEO 3.3.0