hello world.
I'd like to know if it's possible to get stock info for only one company, for example:
I have a content type with companies like Google, Apple, Microsoft, Yahoo etc.
The content type has some fields with information on the company and the Ticker Symbol (stock, whatever)
my question is: Can I display somehow the price info of a company, let's say Google (GOOG) in a field on the content page?
somehow like this: the module gets the ticker from the field_ticker (Ticker Symbol) and displays the information for that ticker/company on the company page (so, for google it displays the info only for GOOG, for yahoo it displays the info only for YHOO. etc)
so it looks like this
Help is very much appreciated!
Comments
Comment #1
beanluc commentedDoes the Views module provide stock data from this module?
If so, you could use the "Insert View" input filter to populate the node field.
Or, maybe you could use "Views Attach", which might make it easier to use arguments based on node field values (ticker symbol = argument).
Views Attach wouldn't store the data (price) in the node's field (and neither would Insert View), but you don't want to do that anyway, or else you'd have a new node revision every hour while the market's open.
Comment #2
frankie_2304 commentedgood ideea but i don't think views provides stock data from this module, i'll take a look.
Thank you!
Comment #3
kbahey commentedSee the stock api module and the README that comes with it. You can call a function to get the quote for a single symbol.
Comment #4
frankie_2304 commentedFIXED
i did this by modifying the code in stock module like this:
and it works.
i have the url like this www.mysite.com/companies/stock/companyticker (using Pathauto)
Thank you for your comments