yahoo_finanza 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yahoo_finanza/finance_utils.rb +11 -0
- data/lib/yahoo_finanza/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8eec01d7178fe8b9594e143eab83e8a30632f0ef
|
4
|
+
data.tar.gz: b230ec6053954c51cd45ef5b5bf1785a11bf7713
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d894214d272c9194992386463ff4bf3558e85ff8a6271d628a9ca2d813f015676eb1ea8c8f2eb9c43b1299b482666fc86b2ac77b1da7f39ec24f0c72fc0ebfd
|
7
|
+
data.tar.gz: 8e83bd13b441e671e189fd46a52f84e9c1fb68046dad4a9b52833d639c41cee9b6ffee74e4cc2ec72053a63259487224f1942d44a7afce99c062fb3b5083746a
|
@@ -28,6 +28,10 @@ module YahooFinanza
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
def search_endpoint(key)
|
32
|
+
"http://d.yimg.com/autoc.finance.yahoo.com/autoc?query=#{key}&callback=YAHOO.Finance.SymbolSuggest.ssCallback"
|
33
|
+
end
|
34
|
+
|
31
35
|
def symbols_by_market(market)
|
32
36
|
symbols = []
|
33
37
|
return symbols if market.nil?
|
@@ -56,6 +60,13 @@ module YahooFinanza
|
|
56
60
|
symbols_by_market('nyse').concat(symbols_by_market('nasdaq'))
|
57
61
|
end
|
58
62
|
|
63
|
+
def search_symbols(key = '')
|
64
|
+
response = RestClient.get search_endpoint(key)
|
65
|
+
result = response.gsub(/YAHOO.Finance.SymbolSuggest.ssCallback\(|\)/, '')
|
66
|
+
json = JSON.parse(result)
|
67
|
+
json['ResultSet']['Result'].map{|quote| quote['symbol']}
|
68
|
+
end
|
69
|
+
|
59
70
|
def active_symbols
|
60
71
|
mecha_yahoo = Mechanize.new
|
61
72
|
symbols = Array.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo_finanza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric D. Santos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yql
|