basic_yahoo_finance 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4af104eb61f63cf64cb6c1d409776442ec60c62ba8b01baca3bf4ccc1e22018
4
- data.tar.gz: 1ebebca0fd572205fa491e13c50d1e145f8eb54b07158ec13c29e24ccadd18e1
3
+ metadata.gz: 814a795de1eab60580b58d3e297d75495cd1b2b253e0282d031be4415304717b
4
+ data.tar.gz: 3b6262e836778a3400063c03789258506a4d298f54a81bd7c45234b6a430f397
5
5
  SHA512:
6
- metadata.gz: b746e4fe7f4393ca96cd4dfb449fafcb8a7aa7f3c9fb8536d252b9eb5a80dc9246f055efe7998759c2fb50a8978da7fcc0f0a1a7b179c75595f93e638bf5ae02
7
- data.tar.gz: 32d06f5f8a2d94a64bff403e483b5289b344ed07f2ec0af482c014aa102641db2c70bec15b83f6272abadc8c11aef26e4d4d92df0b455b8c134597599f9afabd
6
+ metadata.gz: 0c51ebf8d46280e517e6525a66be84ef83a8378defcff07de647a1e3dc6fbfd188dbf95412eac2a731bd3273f8aa92482a30ea366e6f20d2fd70fb73f57a1010
7
+ data.tar.gz: e69d09f901a017af01221054cf2cfa5f374bf2c4d2b35b6232995778b75bafe87c81fe566547e7a40ec1c7b149bb5007c8b8456191b57133c5cb6b3f37d1ea33
data/CHANGELOG.md CHANGED
@@ -5,7 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## 0.1.0 - 2020-01-29
8
+ ## 0.2.0 - 2021-02-05
9
+
10
+ ### Changed
11
+
12
+ - User-Agent header in API requests to announce as "BYF" instead of default "Ruby"
13
+ - Invalid ticker test to new behaviour of the API when the ticker does not exist
14
+
15
+ ## 0.1.0 - 2021-01-29
9
16
 
10
17
  ### Added
11
18
 
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # BasicYahooFinance
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/basic_yahoo_finance.svg)](https://badge.fury.io/rb/basic_yahoo_finance)
4
+
3
5
  This is a simple Ruby gem to query the Yahoo! Finance API.
4
6
 
5
7
  Most of the available gems available on rubygems.org for this purpose are either not maintained anymore or simply do not working due to outdated API code. The goal of this gem is to be as basic as possible, hence the name, and to "simply" work. It would be typcially used to get information such as ask/bid price, close price, volume, for one or more stocks by using its symbol. The data is returned raw directly from the API as JSON output.
@@ -42,6 +44,7 @@ This will return a `Hash` of hashes with each stock information available under
42
44
 
43
45
  ```ruby
44
46
  # Get stock's actual price
47
+
45
48
  data['AVEM']['regularMarketPrice']
46
49
  ```
47
50
 
@@ -12,7 +12,8 @@ module BasicYahooFinance
12
12
  def quotes(symbols)
13
13
  symbols_value = generate_symbols_value(symbols)
14
14
  begin
15
- uri = URI.open("#{API_URL}/v7/finance/quote?symbols=#{symbols_value}")
15
+ uri = URI.open("#{API_URL}/v7/finance/quote?symbols=#{symbols_value}",
16
+ "User-Agent" => "BYF/#{BasicYahooFinance::VERSION}")
16
17
  process_output(JSON.parse(uri.read))
17
18
  rescue OpenURI::HTTPError
18
19
  empty_symbols_hash(symbols)
@@ -39,6 +40,7 @@ module BasicYahooFinance
39
40
  hash[r["symbol"]] = r
40
41
  end
41
42
  end
43
+ # TODO: compare hash keys with symbol(s) requested and add symbols which had no results from API
42
44
  hash
43
45
  end
44
46
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BasicYahooFinance
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basic_yahoo_finance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-29 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest-emoji