I have a simple (and I mean simple) regex code that pulls quotes from yahoo.
What I want is to be able to have an input box that replaces the url with whatever the user inputs. So if user wants to see stock quote of fb the user will enter it in the form field and hit go and then the URL to fetch will change to user input.
There are only going to be 3 users using the url.
Here is my code:
<?php
$content = file_get_contents('http://finance.yahoo.com/q?s=fb&ql=1');
$fb = file_get_contents('http://www.cbssports.com/mlb/teams/page/BOS/boston-red-sox');
$wod = file_get_contents('http://www.wordthink.com');
$ath = file_get_contents('http://finance.yahoo.com/q?s=ATHN');
preg_match('/<span id="yfs_l84_fb">(.*?)<\/span> <\/span>/i', $content, $match);
$price = $match[1];
preg_match('/<span id="yfs_l84_athn">(.*?)<\/span> <\/span>/i', $ath, $match);
$athp = $match[1];
preg_match('#<span id="yfs_l86_fb">(.*)</span></span></p></div>#', $content, $match);
$after = $match[1];
preg_match('/<table class="data" width="100%" >(.*?)<\/b><\/td><\/tr><\/table>/i', $fb, $match);
$fbs = $match[1];
preg_match('/<b>(.*?)<\/b>/', $wod, $match);
$wod1 = $match[1];
preg_match('/<i>(.*?)<\/p>/', $wod, $match);
$wod2 = $match[1];
?>