M
Matthijs de Z
Hi,
I'm having difficulties reading a resultset that yahoo provides using
when you send this request:
http://d.yimg.com/autoc.finance.yah...llback=YAHOO.Finance.SymbolSuggest.ssCallback
(used in an example on http://stackoverflow.com/questions/885456/stock-ticker-symbol-lookup-api)
I've modified the result to a const string like this:
const string myTest = "{\"ResultSet\":{\"Query\":\"ya\",\"Result\":
[{\"symbol\":\"YHOO\",\"name\": \"Yahoo! Inc.\",\"exch\": \"NMS\",
\"type\": \"S\",\"exchDisp\":\"NASDAQ\"},{\"symbol\":\"AUY\",\"name\":
\"Yamana Gold, Inc.\",\"exch\": \"NYQ\",\"type\": \"S\",\"exchDisp\":
\"NYSE\"},{\"symbol\":\"YZC\",\"name\": \"Yanzhou Coal Mining Co. Ltd.
\",\"exch\": \"NYQ\",\"type\": \"S\",\"exchDisp\":\"NYSE\"},{\"symbol
\":\"YRI.TO\",\"name\": \"YAMANA GOLD INC COM NPV\",\"exch\": \"TOR\",
\"type\": \"S\",\"exchDisp\":\"Toronto\"},{\"symbol\":\"8046.TW\",
\"name\": \"NAN YA PRINTED CIR TWD10\",\"exch\": \"TAI\",\"type\": \"S
\",\"exchDisp\":\"Taiwan\"},{\"symbol\":\"600319.SS\",\"name\":
\"WEIFANG YAXING CHE 'A'CNY1\",\"exch\": \"SHH\",\"type\": \"S\",
\"exchDisp\":\"Shanghai\"},{\"symbol\":\"1991.HK\",\"name\": \"TA YANG
GROUP\",\"exch\": \"HKG\",\"type\": \"S\",\"exchDisp\":\"Hong Kong\"},
{\"symbol\":\"1303.TW\",\"name\": \"NAN YA PLASTIC TWD10\",\"exch\":
\"TAI\",\"type\": \"S\",\"exchDisp\":\"Taiwan\"},{\"symbol\":\"0294.HK
\",\"name\": \"YANGTZEKIANG\",\"exch\": \"HKG\",\"type\": \"S\",
\"exchDisp\":\"Hong Kong\"},{\"symbol\":\"YAVY\",\"name\": \"Yadkin
Valley Financial Corp.\",\"exch\": \"NMS\",\"type\": \"S\",\"exchDisp
\":\"NASDAQ\"}]}}";
How can I get the tickers and names in a dictionary (or some object
like that) so I can use it as a dataresource for a textfield
(autocomplete).
I've tried some linq, but it seems that there's no linq functionallity
to Json and I don't know how to get the data needed out of this
resultset.
Any help would be appreciated,.
I'm having difficulties reading a resultset that yahoo provides using
when you send this request:
http://d.yimg.com/autoc.finance.yah...llback=YAHOO.Finance.SymbolSuggest.ssCallback
(used in an example on http://stackoverflow.com/questions/885456/stock-ticker-symbol-lookup-api)
I've modified the result to a const string like this:
const string myTest = "{\"ResultSet\":{\"Query\":\"ya\",\"Result\":
[{\"symbol\":\"YHOO\",\"name\": \"Yahoo! Inc.\",\"exch\": \"NMS\",
\"type\": \"S\",\"exchDisp\":\"NASDAQ\"},{\"symbol\":\"AUY\",\"name\":
\"Yamana Gold, Inc.\",\"exch\": \"NYQ\",\"type\": \"S\",\"exchDisp\":
\"NYSE\"},{\"symbol\":\"YZC\",\"name\": \"Yanzhou Coal Mining Co. Ltd.
\",\"exch\": \"NYQ\",\"type\": \"S\",\"exchDisp\":\"NYSE\"},{\"symbol
\":\"YRI.TO\",\"name\": \"YAMANA GOLD INC COM NPV\",\"exch\": \"TOR\",
\"type\": \"S\",\"exchDisp\":\"Toronto\"},{\"symbol\":\"8046.TW\",
\"name\": \"NAN YA PRINTED CIR TWD10\",\"exch\": \"TAI\",\"type\": \"S
\",\"exchDisp\":\"Taiwan\"},{\"symbol\":\"600319.SS\",\"name\":
\"WEIFANG YAXING CHE 'A'CNY1\",\"exch\": \"SHH\",\"type\": \"S\",
\"exchDisp\":\"Shanghai\"},{\"symbol\":\"1991.HK\",\"name\": \"TA YANG
GROUP\",\"exch\": \"HKG\",\"type\": \"S\",\"exchDisp\":\"Hong Kong\"},
{\"symbol\":\"1303.TW\",\"name\": \"NAN YA PLASTIC TWD10\",\"exch\":
\"TAI\",\"type\": \"S\",\"exchDisp\":\"Taiwan\"},{\"symbol\":\"0294.HK
\",\"name\": \"YANGTZEKIANG\",\"exch\": \"HKG\",\"type\": \"S\",
\"exchDisp\":\"Hong Kong\"},{\"symbol\":\"YAVY\",\"name\": \"Yadkin
Valley Financial Corp.\",\"exch\": \"NMS\",\"type\": \"S\",\"exchDisp
\":\"NASDAQ\"}]}}";
How can I get the tickers and names in a dictionary (or some object
like that) so I can use it as a dataresource for a textfield
(autocomplete).
I've tried some linq, but it seems that there's no linq functionallity
to Json and I don't know how to get the data needed out of this
resultset.
Any help would be appreciated,.