Jump to content


Photo

Scan a URL for a specific word on page????? Need a pro's help...


  • Please log in to reply
2 replies to this topic

#1 wmoussalli

wmoussalli
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 01 June 2006 - 11:06 AM

I need php script that will enable me to scan a url for a specific word, then copy the next word after it to a vaiable...

Imagine scanning this sites hompage for totalposts and then grabbing the following number and displaying it on my site...


Thanking you for your time....

Wayne [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]

#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 01 June 2006 - 11:48 AM

<?php
$filename = "http://www.yourdomain.com/index.php";
$contents = file_get_contents($filename);//read the url
preg_match("`([0-9]+) User\(s\) are browsing this forum`",$contents,$var);//write a RE to parse the contents
?>
//$var[1] will contain the no of users

Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------

#3 wmoussalli

wmoussalli
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 01 June 2006 - 12:21 PM

Thank you very much am trying it now...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users