yahoo_finanza 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/.ruby_version +1 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +356 -0
- data/Rakefile +11 -0
- data/config/amex.yml +397 -0
- data/config/config.yml +3 -0
- data/config/nasdaq.yml +3081 -0
- data/config/nyse.yml +3292 -0
- data/config/sp_500.yml +501 -0
- data/lib/yahoo_finanza/parser.rb +7 -5
- data/lib/yahoo_finanza/version.rb +1 -1
- data/yahoo_finanza.gemspec +32 -0
- metadata +16 -2
data/config/sp_500.yml
ADDED
@@ -0,0 +1,501 @@
|
|
1
|
+
sp_500_symbols:
|
2
|
+
- MMM
|
3
|
+
- ABT
|
4
|
+
- ABBV
|
5
|
+
- ACN
|
6
|
+
- ACE
|
7
|
+
- ATVI
|
8
|
+
- ADBE
|
9
|
+
- ADT
|
10
|
+
- AAP
|
11
|
+
- AES
|
12
|
+
- AET
|
13
|
+
- AFL
|
14
|
+
- AMG
|
15
|
+
- A
|
16
|
+
- GAS
|
17
|
+
- APD
|
18
|
+
- ARG
|
19
|
+
- AKAM
|
20
|
+
- AA
|
21
|
+
- AGN
|
22
|
+
- ALXN
|
23
|
+
- ALLE
|
24
|
+
- ADS
|
25
|
+
- ALL
|
26
|
+
- ALTR
|
27
|
+
- MO
|
28
|
+
- AMZN
|
29
|
+
- AEE
|
30
|
+
- AAL
|
31
|
+
- AEP
|
32
|
+
- AXP
|
33
|
+
- AIG
|
34
|
+
- AMT
|
35
|
+
- AMP
|
36
|
+
- ABC
|
37
|
+
- AME
|
38
|
+
- AMGN
|
39
|
+
- APH
|
40
|
+
- APC
|
41
|
+
- ADI
|
42
|
+
- AON
|
43
|
+
- APA
|
44
|
+
- AIV
|
45
|
+
- AAPL
|
46
|
+
- AMAT
|
47
|
+
- ADM
|
48
|
+
- AIZ
|
49
|
+
- T
|
50
|
+
- ADSK
|
51
|
+
- ADP
|
52
|
+
- AN
|
53
|
+
- AZO
|
54
|
+
- AVGO
|
55
|
+
- AVB
|
56
|
+
- AVY
|
57
|
+
- BHI
|
58
|
+
- BLL
|
59
|
+
- BAC
|
60
|
+
- BK
|
61
|
+
- BCR
|
62
|
+
- BXLT
|
63
|
+
- BAX
|
64
|
+
- BBT
|
65
|
+
- BDX
|
66
|
+
- BBBY
|
67
|
+
- BRK-B
|
68
|
+
- BBY
|
69
|
+
- BIIB
|
70
|
+
- BLK
|
71
|
+
- HRB
|
72
|
+
- BA
|
73
|
+
- BWA
|
74
|
+
- BXP
|
75
|
+
- BSX
|
76
|
+
- BMY
|
77
|
+
- BRCM
|
78
|
+
- BF-B
|
79
|
+
- CHRW
|
80
|
+
- CA
|
81
|
+
- CVC
|
82
|
+
- COG
|
83
|
+
- CAM
|
84
|
+
- CPB
|
85
|
+
- COF
|
86
|
+
- CAH
|
87
|
+
- HSIC
|
88
|
+
- KMX
|
89
|
+
- CCL
|
90
|
+
- CAT
|
91
|
+
- CBG
|
92
|
+
- CBS
|
93
|
+
- CELG
|
94
|
+
- CNP
|
95
|
+
- CTL
|
96
|
+
- CERN
|
97
|
+
- CF
|
98
|
+
- SCHW
|
99
|
+
- CHK
|
100
|
+
- CVX
|
101
|
+
- CMG
|
102
|
+
- CB
|
103
|
+
- CI
|
104
|
+
- XEC
|
105
|
+
- CINF
|
106
|
+
- CTAS
|
107
|
+
- CSCO
|
108
|
+
- C
|
109
|
+
- CTXS
|
110
|
+
- CLX
|
111
|
+
- CME
|
112
|
+
- CMS
|
113
|
+
- COH
|
114
|
+
- KO
|
115
|
+
- CCE
|
116
|
+
- CTSH
|
117
|
+
- CL
|
118
|
+
- CPGX
|
119
|
+
- CMCSA
|
120
|
+
- CMCSK
|
121
|
+
- CMA
|
122
|
+
- CSC
|
123
|
+
- CAG
|
124
|
+
- COP
|
125
|
+
- CNX
|
126
|
+
- ED
|
127
|
+
- STZ
|
128
|
+
- GLW
|
129
|
+
- COST
|
130
|
+
- CCI
|
131
|
+
- CSX
|
132
|
+
- CMI
|
133
|
+
- CVS
|
134
|
+
- DHI
|
135
|
+
- DHR
|
136
|
+
- DRI
|
137
|
+
- DVA
|
138
|
+
- DE
|
139
|
+
- DLPH
|
140
|
+
- DAL
|
141
|
+
- XRAY
|
142
|
+
- DVN
|
143
|
+
- DO
|
144
|
+
- DFS
|
145
|
+
- DISCA
|
146
|
+
- DISCK
|
147
|
+
- DG
|
148
|
+
- DLTR
|
149
|
+
- D
|
150
|
+
- DOV
|
151
|
+
- DOW
|
152
|
+
- DPS
|
153
|
+
- DTE
|
154
|
+
- DD
|
155
|
+
- DUK
|
156
|
+
- DNB
|
157
|
+
- ETFC
|
158
|
+
- EMN
|
159
|
+
- ETN
|
160
|
+
- EBAY
|
161
|
+
- ECL
|
162
|
+
- EIX
|
163
|
+
- EW
|
164
|
+
- EA
|
165
|
+
- EMC
|
166
|
+
- EMR
|
167
|
+
- ENDP
|
168
|
+
- ESV
|
169
|
+
- ETR
|
170
|
+
- EOG
|
171
|
+
- EQT
|
172
|
+
- EFX
|
173
|
+
- EQIX
|
174
|
+
- EQR
|
175
|
+
- ESS
|
176
|
+
- EL
|
177
|
+
- ES
|
178
|
+
- EXC
|
179
|
+
- EXPE
|
180
|
+
- EXPD
|
181
|
+
- ESRX
|
182
|
+
- XOM
|
183
|
+
- FFIV
|
184
|
+
- FB
|
185
|
+
- FAST
|
186
|
+
- FDX
|
187
|
+
- FIS
|
188
|
+
- FITB
|
189
|
+
- FSLR
|
190
|
+
- FE
|
191
|
+
- FISV
|
192
|
+
- FLIR
|
193
|
+
- FLS
|
194
|
+
- FLR
|
195
|
+
- FMC
|
196
|
+
- FTI
|
197
|
+
- F
|
198
|
+
- FOSL
|
199
|
+
- BEN
|
200
|
+
- FCX
|
201
|
+
- FTR
|
202
|
+
- GME
|
203
|
+
- GPS
|
204
|
+
- GRMN
|
205
|
+
- GD
|
206
|
+
- GE
|
207
|
+
- GGP
|
208
|
+
- GIS
|
209
|
+
- GM
|
210
|
+
- GPC
|
211
|
+
- GNW
|
212
|
+
- GILD
|
213
|
+
- GS
|
214
|
+
- GT
|
215
|
+
- GOOGL
|
216
|
+
- GOOG
|
217
|
+
- GWW
|
218
|
+
- HAL
|
219
|
+
- HBI
|
220
|
+
- HOG
|
221
|
+
- HAR
|
222
|
+
- HRS
|
223
|
+
- HIG
|
224
|
+
- HAS
|
225
|
+
- HCA
|
226
|
+
- HCP
|
227
|
+
- HCN
|
228
|
+
- HP
|
229
|
+
- HES
|
230
|
+
- HPQ
|
231
|
+
- HD
|
232
|
+
- HON
|
233
|
+
- HRL
|
234
|
+
- HST
|
235
|
+
- HCBK
|
236
|
+
- HUM
|
237
|
+
- HBAN
|
238
|
+
- ITW
|
239
|
+
- IR
|
240
|
+
- INTC
|
241
|
+
- ICE
|
242
|
+
- IBM
|
243
|
+
- IP
|
244
|
+
- IPG
|
245
|
+
- IFF
|
246
|
+
- INTU
|
247
|
+
- ISRG
|
248
|
+
- IVZ
|
249
|
+
- IRM
|
250
|
+
- JEC
|
251
|
+
- JBHT
|
252
|
+
- JNJ
|
253
|
+
- JCI
|
254
|
+
- JOY
|
255
|
+
- JPM
|
256
|
+
- JNPR
|
257
|
+
- KSU
|
258
|
+
- K
|
259
|
+
- KEY
|
260
|
+
- GMCR
|
261
|
+
- KMB
|
262
|
+
- KIM
|
263
|
+
- KMI
|
264
|
+
- KLAC
|
265
|
+
- KSS
|
266
|
+
- KHC
|
267
|
+
- KR
|
268
|
+
- LB
|
269
|
+
- LLL
|
270
|
+
- LH
|
271
|
+
- LRCX
|
272
|
+
- LM
|
273
|
+
- LEG
|
274
|
+
- LEN
|
275
|
+
- LVLT
|
276
|
+
- LUK
|
277
|
+
- LLY
|
278
|
+
- LNC
|
279
|
+
- LLTC
|
280
|
+
- LMT
|
281
|
+
- L
|
282
|
+
- LOW
|
283
|
+
- LYB
|
284
|
+
- MTB
|
285
|
+
- MAC
|
286
|
+
- M
|
287
|
+
- MNK
|
288
|
+
- MRO
|
289
|
+
- MPC
|
290
|
+
- MAR
|
291
|
+
- MMC
|
292
|
+
- MLM
|
293
|
+
- MAS
|
294
|
+
- MA
|
295
|
+
- MAT
|
296
|
+
- MKC
|
297
|
+
- MCD
|
298
|
+
- MHFI
|
299
|
+
- MCK
|
300
|
+
- MJN
|
301
|
+
- WRK
|
302
|
+
- MDT
|
303
|
+
- MRK
|
304
|
+
- MET
|
305
|
+
- KORS
|
306
|
+
- MCHP
|
307
|
+
- MU
|
308
|
+
- MSFT
|
309
|
+
- MHK
|
310
|
+
- TAP
|
311
|
+
- MDLZ
|
312
|
+
- MON
|
313
|
+
- MNST
|
314
|
+
- MCO
|
315
|
+
- MS
|
316
|
+
- MOS
|
317
|
+
- MSI
|
318
|
+
- MUR
|
319
|
+
- MYL
|
320
|
+
- NDAQ
|
321
|
+
- NOV
|
322
|
+
- NAVI
|
323
|
+
- NTAP
|
324
|
+
- NFLX
|
325
|
+
- NWL
|
326
|
+
- NFX
|
327
|
+
- NEM
|
328
|
+
- NWSA
|
329
|
+
- NWS
|
330
|
+
- NEE
|
331
|
+
- NLSN
|
332
|
+
- NKE
|
333
|
+
- NI
|
334
|
+
- NBL
|
335
|
+
- JWN
|
336
|
+
- NSC
|
337
|
+
- NTRS
|
338
|
+
- NOC
|
339
|
+
- NRG
|
340
|
+
- NUE
|
341
|
+
- NVDA
|
342
|
+
- ORLY
|
343
|
+
- OXY
|
344
|
+
- OMC
|
345
|
+
- OKE
|
346
|
+
- ORCL
|
347
|
+
- OI
|
348
|
+
- PCAR
|
349
|
+
- PH
|
350
|
+
- PDCO
|
351
|
+
- PAYX
|
352
|
+
- PYPL
|
353
|
+
- PNR
|
354
|
+
- PBCT
|
355
|
+
- POM
|
356
|
+
- PEP
|
357
|
+
- PKI
|
358
|
+
- PRGO
|
359
|
+
- PFE
|
360
|
+
- PCG
|
361
|
+
- PM
|
362
|
+
- PSX
|
363
|
+
- PNW
|
364
|
+
- PXD
|
365
|
+
- PBI
|
366
|
+
- PCL
|
367
|
+
- PNC
|
368
|
+
- RL
|
369
|
+
- PPG
|
370
|
+
- PPL
|
371
|
+
- PX
|
372
|
+
- PCP
|
373
|
+
- PCLN
|
374
|
+
- PFG
|
375
|
+
- PG
|
376
|
+
- PGR
|
377
|
+
- PLD
|
378
|
+
- PRU
|
379
|
+
- PEG
|
380
|
+
- PSA
|
381
|
+
- PHM
|
382
|
+
- PVH
|
383
|
+
- QRVO
|
384
|
+
- PWR
|
385
|
+
- QCOM
|
386
|
+
- DGX
|
387
|
+
- RRC
|
388
|
+
- RTN
|
389
|
+
- O
|
390
|
+
- RHT
|
391
|
+
- REGN
|
392
|
+
- RF
|
393
|
+
- RSG
|
394
|
+
- RAI
|
395
|
+
- RHI
|
396
|
+
- ROK
|
397
|
+
- COL
|
398
|
+
- ROP
|
399
|
+
- ROST
|
400
|
+
- RCL
|
401
|
+
- R
|
402
|
+
- CRM
|
403
|
+
- SNDK
|
404
|
+
- SCG
|
405
|
+
- SLB
|
406
|
+
- SNI
|
407
|
+
- STX
|
408
|
+
- SEE
|
409
|
+
- SRE
|
410
|
+
- SHW
|
411
|
+
- SIAL
|
412
|
+
- SIG
|
413
|
+
- SPG
|
414
|
+
- SWKS
|
415
|
+
- SLG
|
416
|
+
- SJM
|
417
|
+
- SNA
|
418
|
+
- SO
|
419
|
+
- LUV
|
420
|
+
- SWN
|
421
|
+
- SE
|
422
|
+
- STJ
|
423
|
+
- SWK
|
424
|
+
- SPLS
|
425
|
+
- SBUX
|
426
|
+
- HOT
|
427
|
+
- STT
|
428
|
+
- SRCL
|
429
|
+
- SYK
|
430
|
+
- STI
|
431
|
+
- SYMC
|
432
|
+
- SYY
|
433
|
+
- TROW
|
434
|
+
- TGT
|
435
|
+
- TEL
|
436
|
+
- TE
|
437
|
+
- TGNA
|
438
|
+
- THC
|
439
|
+
- TDC
|
440
|
+
- TSO
|
441
|
+
- TXN
|
442
|
+
- TXT
|
443
|
+
- HSY
|
444
|
+
- TRV
|
445
|
+
- TMO
|
446
|
+
- TIF
|
447
|
+
- TWX
|
448
|
+
- TWC
|
449
|
+
- TJX
|
450
|
+
- TMK
|
451
|
+
- TSS
|
452
|
+
- TSCO
|
453
|
+
- RIG
|
454
|
+
- TRIP
|
455
|
+
- FOXA
|
456
|
+
- FOX
|
457
|
+
- TSN
|
458
|
+
- TYC
|
459
|
+
- USB
|
460
|
+
- UA
|
461
|
+
- UNP
|
462
|
+
- UAL
|
463
|
+
- UNH
|
464
|
+
- UPS
|
465
|
+
- URI
|
466
|
+
- UTX
|
467
|
+
- UHS
|
468
|
+
- UNM
|
469
|
+
- URBN
|
470
|
+
- VFC
|
471
|
+
- VLO
|
472
|
+
- VAR
|
473
|
+
- VTR
|
474
|
+
- VRSN
|
475
|
+
- VZ
|
476
|
+
- VRTX
|
477
|
+
- VIAB
|
478
|
+
- V
|
479
|
+
- VNO
|
480
|
+
- VMC
|
481
|
+
- WMT
|
482
|
+
- WBA
|
483
|
+
- DIS
|
484
|
+
- WM
|
485
|
+
- WAT
|
486
|
+
- ANTM
|
487
|
+
- WFC
|
488
|
+
- WDC
|
489
|
+
- WU
|
490
|
+
- WY
|
491
|
+
- WHR
|
492
|
+
- WFM
|
493
|
+
- WMB
|
494
|
+
- WEC
|
495
|
+
- WYN
|
496
|
+
- WYNN
|
497
|
+
- XEL
|
498
|
+
- XRX
|
499
|
+
- XLNX
|
500
|
+
- XL
|
501
|
+
- XYL
|
data/lib/yahoo_finanza/parser.rb
CHANGED
@@ -29,14 +29,16 @@ module YahooFinanza
|
|
29
29
|
def single_yahoofy(payload)
|
30
30
|
jsons = JSON.parse(payload)['query']['results']['quote']
|
31
31
|
result = OpenStruct.new(viperize_hash(jsons))
|
32
|
-
|
33
|
-
result
|
32
|
+
result.name ? result : ''
|
34
33
|
end
|
35
34
|
|
36
35
|
def historical_yahoofy(payload)
|
37
|
-
jsons = JSON.parse(payload)['query']['results']
|
38
|
-
|
39
|
-
|
36
|
+
jsons = JSON.parse(payload)['query']['results']['quote']
|
37
|
+
if jsons.class == Hash
|
38
|
+
OpenStruct.new(viperize_hash(jsons))
|
39
|
+
else
|
40
|
+
jsons.map { |symbol| OpenStruct.new(viperize_hash(symbol)) }
|
41
|
+
end
|
40
42
|
end
|
41
43
|
|
42
44
|
def viperize(symbol)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'yahoo_finanza/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'yahoo_finanza'
|
8
|
+
spec.version = YahooFinanza::VERSION
|
9
|
+
spec.authors = ['Eric D. Santos', 'Robert Grayson']
|
10
|
+
spec.email = ['eric.santos@cometa.works']
|
11
|
+
spec.summary = 'An easy to use and updated yahoo finance gem with
|
12
|
+
finance utils and a Yahoo Finance Client.'
|
13
|
+
spec.description = 'An easy to use and updated yahoo finance gem with
|
14
|
+
finance utils and a Yahoo Finance Client.'
|
15
|
+
spec.homepage = 'https://github.com/cometaworks/yahoo_finanza'
|
16
|
+
spec.license = 'MIT'
|
17
|
+
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ['lib']
|
22
|
+
|
23
|
+
spec.add_dependency 'yql'
|
24
|
+
spec.add_dependency 'mechanize'
|
25
|
+
spec.add_dependency 'rest-client'
|
26
|
+
spec.add_dependency 'fuzzy-string-match'
|
27
|
+
|
28
|
+
spec.add_development_dependency 'bundler', '~> 1.7'
|
29
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
30
|
+
spec.add_development_dependency 'rspec'
|
31
|
+
spec.add_development_dependency 'pry'
|
32
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yahoo_finanza
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric D. Santos
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-10-
|
12
|
+
date: 2015-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: yql
|
@@ -132,12 +132,26 @@ executables: []
|
|
132
132
|
extensions: []
|
133
133
|
extra_rdoc_files: []
|
134
134
|
files:
|
135
|
+
- ".gitignore"
|
136
|
+
- ".rspec"
|
137
|
+
- ".ruby_version"
|
138
|
+
- ".travis.yml"
|
139
|
+
- Gemfile
|
140
|
+
- LICENSE.txt
|
141
|
+
- README.md
|
142
|
+
- Rakefile
|
143
|
+
- config/amex.yml
|
144
|
+
- config/config.yml
|
145
|
+
- config/nasdaq.yml
|
146
|
+
- config/nyse.yml
|
147
|
+
- config/sp_500.yml
|
135
148
|
- lib/yahoo_finanza.rb
|
136
149
|
- lib/yahoo_finanza/client.rb
|
137
150
|
- lib/yahoo_finanza/constants.rb
|
138
151
|
- lib/yahoo_finanza/parser.rb
|
139
152
|
- lib/yahoo_finanza/version.rb
|
140
153
|
- lib/yahoo_finanza/workers.rb
|
154
|
+
- yahoo_finanza.gemspec
|
141
155
|
homepage: https://github.com/cometaworks/yahoo_finanza
|
142
156
|
licenses:
|
143
157
|
- MIT
|