Want to get the latest stock quotes for your favorite stock symbol? This recipe will let us use the "stock" keyword to trigger a lookup of the latest stock quotes.
So for example, sending a text of "stock AAPL" will return the latest stock information for the AAPL symbol.
This recipe will let us search Yahoo Finance for today's price quote by using the stock symbol. Create a file called stock.php
in the pages
folder and add the following code to it:
<?php $results = stock( $keywords ); $i = 1; $reply = array(); $quote = $results->quote; $msg = $quote->symbol.' - '.$quote->LastTradePriceOnly.' - '.$quote->Change.' - '.$quote->PercentChange; $reply[] = $msg; print_sms_reply( $reply ); function stock( $symbol ){ $yelpql = " USE 'http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml' AS yahoo.finance.quotes;select...