有 Yahoo 查询语言 (YQL) 的 .NET 示例吗?
我想对 Yahoo 查询语言 (YQL) 进行一些简单的调用。有人在.NET 中实现过这个吗?
这是我想从 .NET 发出的查询:
select MarketCapitalization
from yahoo.finance.quotes
where symbol
in ("YHOO","AAPL","GOOG","MSFT","unknown")
更新
一切都 100% 正常工作,谢谢@fernaramburu。
I'd like to make some simple calls to Yahoo Query Language (YQL). Has anyone implemented this in .NET?
Here is the query I'd like to make from .NET:
select MarketCapitalization
from yahoo.finance.quotes
where symbol
in ("YHOO","AAPL","GOOG","MSFT","unknown")
Update
Everything is working 100%, thanks @fernaramburu.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的。有两个很好的例子确实有效,因为我几个小时前刚刚测试过......
http:// /jarloo.com/get-yahoo-finance-api-data-via-yql/
和
http ://jarloo.com/code/get-historical-stock-data/
希望这有帮助!这对我有很大帮助!
Yes. There two good examples that are actually working because I just tested some hours ago...
http://jarloo.com/get-yahoo-finance-api-data-via-yql/
and
http://jarloo.com/code/get-historical-stock-data/
Hope this help! It helps me a lot!
这并不是一个真正的示例,但完整的 .NET 库是 Yahoo!财务管理。
您可以在此处找到有关使用该库的说明。
Not really an example, but a complete .NET library is Yahoo! Finance Managed.
A description for using the lib can you find here.
然后 WebRequest 将是您的朋友。
您可以找到大量有关如何对网络上的 Web 服务进行 GET 调用的信息。
或者您正在谈论 LINQ-Provider?
Then WebRequest would be your friend.
You can find tons of information how to make GET calls to a webservice on the net.
Or are you talking about a LINQ-Provider?
这里有一个完整的示例(带有可下载的.NET源代码):
http://andy.edinborough .org/C-OAuth-Implementation/
此示例实现 OAuth,让您能够利用 100,000 个请求/天和 10,000 个请求/小时的较高使用限制。
要创建 OAuth 密钥,请参阅 因此,您想使用一些 Yahoo! API。
如果不进行微小的更改,代码将无法工作:将披萨查询替换为“显示表”。
更新:
如果不将以下字符串附加到查询中,YQL 将无法使用:
完整的查询字符串为:
要从 YQL 查询获取完整的查询 URL:
select * from yahoo.finance.quotes where symbol in ("MSFT")
&env=http%3A %2F%2Fdatatables.org%2Falltables.env
到两个重载的QueryYahoo
函数中的 URL。There is a complete example (with downloadable .NET source code) here:
http://andy.edinborough.org/C-OAuth-Implementation/
This example implements OAuth to let you take advantage of the higher usage limit of 100,000 requests / day and 10,000 requests / hour.
To create an OAuth key, see So, you want to use some Yahoo! APIs.
The code won't work without a minor change: replace the query for pizza with "show tables".
Update:
YQL didn't work with without appending the following string to the query:
The full query string is:
To obtain a full query URL from a YQL query:
select * from yahoo.finance.quotes where symbol in ("MSFT")
&env=http%3A%2F%2Fdatatables.org%2Falltables.env
to the url within the two overloadedQueryYahoo
functions.