tickerpicker 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 00f099b7d1bf241107b8f190bd1ac33035bbcac6
4
- data.tar.gz: c1814d7cb4f770092de723acd7942daa4bdcb2b7
3
+ metadata.gz: 221f4d7f779657003db135030cdcdb1e4a44978b
4
+ data.tar.gz: ba2b13a4ee668be24424adcee5a6155dc07a8454
5
5
  SHA512:
6
- metadata.gz: 8038240dd655305453a7b15edc3fac7ad46fc2bcfe9f4ab0975490de8610da6c8df6753ac1f88dd7ac5bf7a4ed5831228eb94bca1d544f87be085ffe3f5e6efc
7
- data.tar.gz: 02d521026b877b8363488b6538c7a7001f960fcc323361e32c25ffa12523fc84e54da7a5b96bd772e0c2452e13ebf2db4e3b5d807a2163b6fb86211cfe3ff781
6
+ metadata.gz: a22df07b851ff024d969b8c2a5dcea69689ff9057f98c6fc5f941c0053e455b828c3c0829c8f042be1406d454ccd82d663e9cb87fe641c33acc6e53dc87d5ed7
7
+ data.tar.gz: 6e38487a6817c848cdb0c8c794a0faeb47d8d016263abce8c93448f31e2f3a0d7ec7f7b7e7dc7ca13be2cfb73151b5aa4cf7fd420f462d5bf43013f9c258c270
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
data/README.md CHANGED
@@ -20,36 +20,48 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
  Register stocks from avaliable stock list
23
+
23
24
  TickerPicker::Ticker.register "mtgox"
25
+ TickerPicker::Ticker.register "btce"
26
+
24
27
  Or register multiple stocks:
28
+
25
29
  TickerPicker::Ticker.register_list ["mtgox", "btce", "bitstamp"]
26
30
 
27
31
  Get prices from the stock's specific market:
28
- prices = TickerPicker::Ticker.get_prices 'mtgox', 'btc_usd'
32
+
33
+ prices_mtgox_usd = TickerPicker::Ticker.get_prices 'mtgox', 'btc_usd'
34
+ prices_bitstamp_usd = TickerPicker::Ticker.get_prices 'bitstamp', 'btc_usd'
29
35
 
30
36
  Print all prices as hash:
31
- puts prices.to_dh
37
+
38
+ puts prices_mtgox_usd.to_dh
32
39
 
33
40
  Print specific info from prices:
34
- puts prices.ask
35
- puts prices.bid
36
- puts prices.last
37
- puts prices.timestamp
38
- puts prices.currency
41
+
42
+ puts prices_mtgox_usd.ask
43
+ puts prices_mtgox_usd.bid
44
+ puts prices_mtgox_usd.last
45
+ puts prices_mtgox_usd.timestamp
46
+ puts prices_mtgox_usd.currency
39
47
 
40
48
  Get prices from the stock
49
+
41
50
  mtgox_markets = TickerPicker::Ticker.get_all_stock_prices 'mtgox'
42
51
 
43
52
  Get prices from all avaliable stock-markets
53
+
44
54
  all_stock_markets = TickerPicker::Ticker.get_all_stock_market_prices
45
55
 
46
56
  ## Configuration (optional & advanced)
47
57
  Set your stocks.yml file path if you need to modify default
58
+
48
59
  TickerPicker.configure do |config|
49
60
  config.stock_configuration_file = "#{File.dirname(__FILE__)}/stocks.yml" # your stocks.yml path
50
61
  end
51
62
 
52
63
  Add new markets to the stocks(sample: your stocks.yml)
64
+
53
65
  bitstamp:
54
66
  btc_usd:
55
67
  url: 'https://www.bitstamp.net/api/ticker/'
@@ -61,9 +73,6 @@ Add new markets to the stocks(sample: your stocks.yml)
61
73
  btc_eur:
62
74
  url: 'https://btc-e.com/api/2/btc_eur/ticker'
63
75
  currency: 'EUR'
64
- btc_rub:
65
- url: 'https://btc-e.com/api/2/btc_rub/ticker'
66
- currency: 'RUB'
67
76
  btcturk:
68
77
  btc_try:
69
78
  url: 'https://btcturk.com/api/ticker/'
@@ -78,10 +87,18 @@ Add new markets to the stocks(sample: your stocks.yml)
78
87
 
79
88
 
80
89
  ## Available Stocks
81
- MTGOX
82
- BTC-E
83
- BITSTAMP
84
- BTCTURK
90
+
91
+ BTC-E (btce)
92
+
93
+ BITSTAMP (bitstamp)
94
+
95
+ BTCTURK (btcturk)
96
+
97
+ MTGOX (mtgox)
98
+
99
+ ## Donations
100
+ I accept donations :)
101
+ https://blockchain.info/address/182dMXGmdVYgv6m1qXq3tncoPfDfBmvtBM
85
102
 
86
103
  ## Contributing
87
104
 
@@ -54,7 +54,7 @@ module TickerPicker
54
54
  # * +Hash+ - Hash of information for given stock-market uri
55
55
  #
56
56
  def gather_info(url)
57
- response = open(url, 'User-Agent' => user_agent, read_timeout: 2).read
57
+ response = url =~ URI::regexp ? open(url, 'User-Agent' => user_agent, read_timeout: 2).read : open(url).read
58
58
  JSON.parse(response)
59
59
  end
60
60
 
@@ -9,9 +9,6 @@ btce:
9
9
  btc_eur:
10
10
  url: 'https://btc-e.com/api/2/btc_eur/ticker'
11
11
  currency: 'EUR'
12
- btc_rub:
13
- url: 'https://btc-e.com/api/2/btc_rub/ticker'
14
- currency: 'RUB'
15
12
  btcturk:
16
13
  btc_try:
17
14
  url: 'https://btcturk.com/api/ticker/'
@@ -1,3 +1,3 @@
1
1
  module TickerPicker
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tickerpicker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mustafa Turan
@@ -14,42 +14,42 @@ dependencies:
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
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: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashable
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 0.1.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.1.2
55
55
  description: Ticker Picker for cryto currencies like BTC, LTC in world stocks
@@ -59,7 +59,8 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
62
+ - ".gitignore"
63
+ - ".travis.yml"
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md
@@ -92,17 +93,17 @@ require_paths:
92
93
  - lib
93
94
  required_ruby_version: !ruby/object:Gem::Requirement
94
95
  requirements:
95
- - - '>='
96
+ - - ">="
96
97
  - !ruby/object:Gem::Version
97
98
  version: '0'
98
99
  required_rubygems_version: !ruby/object:Gem::Requirement
99
100
  requirements:
100
- - - '>='
101
+ - - ">="
101
102
  - !ruby/object:Gem::Version
102
103
  version: '0'
103
104
  requirements: []
104
105
  rubyforge_project:
105
- rubygems_version: 2.0.3
106
+ rubygems_version: 2.2.0
106
107
  signing_key:
107
108
  specification_version: 4
108
109
  summary: Ticker Picker for cryto currencies like BTC, LTC