ystock 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5af1d3066dbe3fb3ae3288aa4c3b8de657d88ef6
4
- data.tar.gz: 6d68ba22fb445714c5c71dc866753cf99c0169db
3
+ metadata.gz: 7cdaecc215cb1f6b26f3d44eb5c0b23a3f2bae38
4
+ data.tar.gz: ed3f28525276055b6340f03f58c12d3765262b59
5
5
  SHA512:
6
- metadata.gz: e12f7bdbdc05002dbcfb8a637e7e58d41ff7c5edd813982bb06448d4d984278bd87901999b3e8b170dd355b131f3218aa9c24fa9d9e437392a8f023c04bbe536
7
- data.tar.gz: be46418c6705a83f57d96fd9f74523fc1dc1fb5ddf27c92610eca1d544efe379baa3d87b2583b52eba28353628e419fe426fdfb9fa98e6f892ec875828448a68
6
+ metadata.gz: 847bb1caaf97f44fdfd8d59be9ef05612b868167bb8326d1c1a5135628f76502db1d77c0f04f7e7a4819443004c216b6950bbcf7c09bc82599e8791a4a713659
7
+ data.tar.gz: d55b331e836d56365b64f42e60d62a5609c0f5b1bdeaf0c161ec30fb7842bf5bb47155c7f2a58eeb4fe66b37c8d027700f9cf3d8d7b5ad046b6443cb7c9c348c
@@ -1,15 +1,15 @@
1
1
  # Ystock
2
- This gem provides you with the latest market data avalable, pulling from both Google and Yahoo Finance.
2
+ This gem provides you with the latest market data avalable, pulling from Yahoo Finance.
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/ystock.png)](http://badge.fury.io/rb/ystock) [![Build Status](https://travis-ci.org/gregwinn/ystock.png?branch=master)](https://travis-ci.org/gregwinn/ystock) [![Code Climate](https://codeclimate.com/github/gregwinn/ystock.png)](https://codeclimate.com/github/gregwinn/ystock)
5
5
 
6
6
  ## Install
7
7
  Add the following to your Gemfile
8
8
  ```ruby
9
- gem "ystock", "~> 0.4.6"
9
+ gem "ystock", "~> 0.4.8"
10
10
 
11
11
  # Or simply install it
12
- gem install ystock -v=0.4.6
12
+ gem install ystock -v=0.4.8
13
13
  ```
14
14
 
15
15
  ## Bundle
@@ -22,21 +22,15 @@ bundle install
22
22
  require 'ystock'
23
23
  ```
24
24
 
25
- ----
26
-
27
- # Google No longer supported :(
28
-
29
- Sorry, Google shut this service down. The code will remain in the gem until a later version as a memorial to the Google Finance API.
30
-
31
-
32
25
  ----
33
26
 
34
27
  # Yahoo Usage
28
+ The examples below are how to use the Yahoo potion of the gem. All Yahoo requests are made with Ystock::Yahoo
35
29
 
36
30
  ## Quote Usage
37
31
  ```ruby
38
32
  # Single Stock lookup {String}
39
- Ystock::Yahoo.quote("appl")
33
+ Ystock::Yahoo.quote("aapl")
40
34
 
41
35
  # Multiple Stock lookup {Array}
42
36
  Ystock::Yahoo.quote(["aapl", "f", "goog"])
@@ -58,6 +52,7 @@ ma50 => 50 day moving average
58
52
  ma200 => 200 day moving average
59
53
  week52_range => 52 week range
60
54
  pe_ratio => P/E Ratio (Realtime)
55
+ exchange
61
56
  ```
62
57
 
63
58
  ----
@@ -70,3 +65,5 @@ Ruby: ~~1.9.2~~ -> No longer supported.
70
65
  Ruby: 1.9.3
71
66
 
72
67
  Ruby: 2.0.0
68
+
69
+ Ruby: 2.1.2
@@ -1,3 +1,9 @@
1
+ # This code is in the repo at this point for historical use
2
+ # I will replace it with something new or move it to a historical
3
+ # branch at some point.
4
+ #
5
+ # Google's Finance API shutdown some time ago.
6
+ # No Ystock::Google methods will function.
1
7
  module Ystock
2
8
  class Google
3
9
  @@google_service = "http://www.google.com/ig/api"
@@ -43,7 +43,8 @@ module Ystock
43
43
  :ma50 => a[10],
44
44
  :ma200 => a[11],
45
45
  :week52_range => a[12].gsub("\r\n", "").gsub('"', ''),
46
- :pe_ratio => a[13]
46
+ :pe_ratio => a[13],
47
+ :exchange => a[14]
47
48
  }
48
49
  end
49
50
 
@@ -68,7 +69,9 @@ module Ystock
68
69
  :ma50 => stockdata[10],
69
70
  :ma200 => stockdata[11],
70
71
  :week52_range => stockdata[12].gsub("\r\n", "").gsub('"', ''),
71
- :pe_ratio => stockdata[13]}
72
+ :pe_ratio => stockdata[13],
73
+ :exchange => stockdata[14]
74
+ }
72
75
 
73
76
  end
74
77
  end
@@ -77,7 +80,7 @@ module Ystock
77
80
  end
78
81
 
79
82
  def self.send_request(args)
80
- completed_path = @@service_uri + "?f=l1c1vsp2ohgpc8m3m4wr2&s=" + args
83
+ completed_path = @@service_uri + "?f=l1c1vsp2ohgpc8m3m4wr2x&s=" + args
81
84
  uri = URI.parse(completed_path)
82
85
  response = Net::HTTP.start(uri.host, uri.port) do |http|
83
86
  http.get completed_path
@@ -1,8 +1,8 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ystock'
3
- s.version = "0.4.6"
3
+ s.version = "0.4.8"
4
4
  s.authors = ["Greg Winn"]
5
- s.date = %q{2012-06-09}
5
+ s.date = %q{2014-11-24}
6
6
  s.description = %q{Grab stock information from Yahoo and Google Finance}
7
7
  s.email = %q{greg@winn.ws}
8
8
  s.extra_rdoc_files = ["README.markdown", "lib/ystock.rb"]
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ystock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Winn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2012-06-09 00:00:00.000000000 Z
11
+ date: 2014-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.10.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.10.1
27
27
  description: Grab stock information from Yahoo and Google Finance
@@ -47,17 +47,17 @@ require_paths:
47
47
  - lib
48
48
  required_ruby_version: !ruby/object:Gem::Requirement
49
49
  requirements:
50
- - - ">="
50
+ - - '>='
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - ">="
55
+ - - '>='
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
59
  rubyforge_project:
60
- rubygems_version: 2.2.2
60
+ rubygems_version: 2.2.0
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: Grab stock information from Yahoo and Google Finance