bemoi Posted December 3, 2008 Share Posted December 3, 2008 Hi All, I've been threw ALOT in the web business but now im totally lost, hope sum1 can lend me a hand in here. the situation is: i'm developing a website using joomla, in that website there'll be a block which contains the "Stock's Share Price" for the company. the thing is, it's an egyptian company, so yahoo finance doesnt have its info on it, so the only way to make the share price live updated on my website is to screen scrape the original page to mine original page: https://www.arabfinance.com/MarketStatistics/Quotes.aspx?Id=1725 so, any way to extract the " Last Price - Net Change - % Change - Volume - Currency " Date To Another HTML File??? Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted December 3, 2008 Share Posted December 3, 2008 This is quite simple but you are better setting a cron job to grab the data in given intervals rather than requesting live from your site page. The remote site will end up banning your IP if traffic is high and your page load time could be slowed if the remote site is busy. In your script Use CURL to grab https://www.arabfinance.com/MarketStatistics/Quotes.aspx?Id=1725 Then simply use regular expressions to extract the data you require from the HTML. Save the extracted data to your website database. Your website can then display the data from your database. Easy Quote Link to comment Share on other sites More sharing options...
pyrodude Posted December 6, 2008 Share Posted December 6, 2008 If you don't have access to cron jobs, however, you could store the values you retrieve in a database then compare the current time with the last time it was retrieved and see if you need to go get the up-to-date info. You'll still be stuck with the slow load time, however. Another option would be to use an iframe to load a separate php file (possible through AJAX) that does nothing but pull the information and display it. That way your page will load quickly and just the stock price will take a minute to display. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.