473,654 Members | 3,109 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

partial ot ... stock market feed

I'm looking to add a page to my site where I can get stock quotes for the
wired, but more importantly, the wireless web(ie my cell phone). I know how
write the needed php and WAP application, I just don't know where to get the
stock market feed, at least not without parsing a finance.yahoo.c om page.
Or something else like it that could change at any time. I'm looking for
just the raw data feed. Anyone ever had to do this and can give me some
info on a feed??????

--
Chris Mosser
Jul 17 '05 #1
1 3345
"Chris Mosser" <cmosser_at_com cast_dot_net> wrote:
I'm looking to add a page to my site where I can get stock quotes for the
wired, but more importantly, the wireless web(ie my cell phone). I know
how write the needed php and WAP application, I just don't know where to
get the stock market feed, at least not without parsing a
finance.yahoo.c om page.
Or something else like it that could change at any time. I'm looking for
just the raw data feed. Anyone ever had to do this and can give me some
info on a feed??????

--
Chris Mosser


Hi

I just wrote a bunch of them. :P
You CAN use Yahoo without parsing the HTML.
Use their http://quote.yahoo.com/download/quotes.csv

Here follows a clumsy script to get you going:
(sorry, I think I exceed linelength, you have to repair by hand)
Regards,
Erwin Moller
function getAllQuotes($s ymbolsarray) {
// returns an array with arrays with data
$allQuotes = array();

$baseurl =
"http://quote.yahoo.com/download/quotes.csv?form at=snlx&ext=.cs v&symbols=";
// make the symbols urlencoded.
$urlsymbols = urlencode(implo de(" ",$symbolsarray ));

$quotesURL = $baseurl.$urlsy mbols;

$csv = file($quotesURL );

foreach ($csv as $line_num => $line) {
// if NOT exists format: "^AEX2","^AEX2" , "N/A - <b>0.00</b>",
"N/A"
// if exists format: "^AEX" ,"AEX-Index","7:37
am - <b>326.71</b>", "Amsterdam"
//
"AHOc.BA","ROYA L AHOLD","Aug 28, 2002 - <b>16.435</b>","Buenos Aires"
//
"MSFT.AS","MICR OSOFT CORP","Oct 20 - <b>27.82</b>","Amsterdam "

// Please not the , in the date of AHOc.BA

// shame I don't know a better value for the 'format' in the baseurl.
:-(

// split on ","
$parts = explode("\",\"" ,$line);
$oneQuote = array();
$oneQuote["symbol"] = trim(trim($part s[0]) , "\"");
$oneQuote["name"] = trim(trim($part s[1]) , "\"");
$oneQuote["place"] = trim(trim($part s[3]) , "\"");

$val = trim($parts[2] , "\"");

// remove all before <b> and remove the last </b>
// remove 6:30am - <b>
$val = substr($val, strpos($val, "<b>")+3) ;

// remove </b>
$val = substr($val , 0 , -4) ;

$oneQuote["value"] = $val;

// add to allQuotes
$allQuotes[$oneQuote["symbol"]] = $oneQuote;
}
return $allQuotes;
}
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9620
by: Francesco Moi | last post by:
Hello everyone, Does anyone know where I can get free stock quotes in XML format? Thanks,
7
16853
by: simon | last post by:
Hi I know this has been done to death....but obviously at some point in the dim and distant past! I wish to program a retail database for my shop, I have trawled many forums and I only manage to see "search for inventory, this has been done many times before...", without ever actually coming across the method ;( Could some kind person just give an overview of the 'correct' way to achieve this please?
8
2310
by: Chris | last post by:
I'm currently writing a custom financial app that tracks stock purchases and values. however, I need help in retrieving stock quotes from the internet. A 20 minute delayed quote is fine. I do not want to revert to "page or screen scraping". any guidance/code references are much appreciated. thank you! in advance.
1
3187
by: Lorn | last post by:
I'm going to be attempting my most challenging programming task to date and was wondering if I could get some input on what would be the most efficient way of working with stock price quote data for an entire order book. I'm working with a raw text data stream that delivers quotes in realtime for each price level with the quantity of shares, the ID of the exchange that is honoring the quote, and the side of the market it is on. For...
2
3376
by: Hank | last post by:
Hello, Does anyone have a formula for calculating the number of days a stock was owned? Of course its real easy if you buy 100 shares on April 1 and sell 100 shares on July 1 but what about multiple buys and sells of different number of shares. As an example: Buy 100 April 1, Buy 200 May 1, Sell 50 June 1, Sell 250 July 1. For tax purposes we need to know the average number of days the stock was held. In the calculation, I believe...
5
3344
by: kalyxo | last post by:
Hi all! For one of our web-communities we plan an offer of real time stock quotes incl. advanced notification services. I have the following questions: - Do you know of any services, that already offers such services in a decent way? And more important:
5
7495
by: Mudcat | last post by:
I have done a bit of searching and can't seem to find a stock market tool written in Python that is active. Anybody know of any? I'm trying not to re-create the wheel here.
2
2177
by: whiskeylima64 | last post by:
I'm a newbie in oracle 10g - I was hoping if some one could walk me through writing a trigger function for this particular problem: the scenario: " ... the practice is called backdating because an executive manages to move the date of a stock option back in time, presumably to when the stock price was lower. Stock options grant the recipient the right to buy shares at the stated price after a certain period of time has gone by. If the market...
5
1389
by: Shalini Bhalla | last post by:
i want to make a site on Stock Market for which i need to capture current stock market prices for processing . Can you tell me how i an get that data ?
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.