cryptocompare 0.13.0 → 0.14.0

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: aa21dd8a62b76ee16cc74571716557f97929fbf0
4
- data.tar.gz: ef06d7fee31527c7786c809098fde9976194081f
3
+ metadata.gz: 85448bc68e79750ba47e5272dd60c7e491c58833
4
+ data.tar.gz: bb061c94690676f3eddf1d8c25d26767af48b8e5
5
5
  SHA512:
6
- metadata.gz: 41b88ba0309ffbba536dbbdfa590f759acb72dbb178af838faf00f845b2bfad0a02c9635fcd1e4db7e5249ea5813f76f12ea4f78f08f73405e54d39c587334e7
7
- data.tar.gz: ef93438e5d9ff1c2f239ae5e2c5d960b80af4305c21d05dfbc7bbd299597d709ced0dd7bc3d490721d9f8572b09e345508e167626cc4ad4a4c14675b5780d155
6
+ metadata.gz: 7a890616f9edf3aa66707ddc2f3e25cdb62ca8a1c5a5c831a51287c25d12f56895a50f7e3e82fde215ebe2173a64dc89e1d86b985fee3923d95b3521967b3727
7
+ data.tar.gz: 4c35a099b060c1c1afa67416684c4f0e2c4b4b32818a9325c2edb07e0d8cc0a7b184da0002bc18c943cbfb8dbc1c2fcdd1afb58fe82a160a269c0463b7a9807e
data/README.md CHANGED
@@ -512,6 +512,73 @@ Cryptocompare::HistoDay.find('BTC', 'USD')
512
512
  # }
513
513
  ```
514
514
 
515
+ ## News
516
+ Get news articles from the providers that CryptoCompare has integrated with as well as news provider data.
517
+
518
+ **Example:**
519
+
520
+ Get news articles from the providers that CryptoCompare has integrated with.
521
+
522
+ ```ruby
523
+ Cryptocompare::News.all
524
+ # => [
525
+ # {
526
+ # "id" => "85721",
527
+ # "guid" => "https://news.bitcoin.com/?p=127153",
528
+ # "published_on" => 1520834400,
529
+ # "imageurl" => "https://images.cryptocompare.com/news/bitcoin.com/b9MBw3g640c.jpeg",
530
+ # "title" => "Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades",
531
+ # "url" => "https://news.bitcoin.com/study-finds-3b-worth-of-faked-cryptocurrency-volumes-and-wash-trades/",
532
+ # "source" => "bitcoin.com",
533
+ # "body" => "On March 10 a cryptocurrency trader and researcher published a report on how he believes $3 billion worth of cryptocurrency trade volumes, primarily from a couple of exchanges, are concocted. The author of the study, Sylvain Ribes, alleges that the exchange Okcoin has been fabricating up to 93 percent of its trade volumes. Also read: Thailand [&#8 230;]The post Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades appeared first on Bitcoin News.",
534
+ # "tags" => "News|95%|altcoin exchange|Binance|Bitcoin|BTC|Coinmarketcap|Fake Trades|GDAX|Huobi|illiquid assets|Kraken|Liquidity|Livecoinwatch|N-Featured|OKcoin|Okex|Poloniex|Sylvain Ribes|trading|Volumes|Wash Trades|Zhao Changpeng",
535
+ # "categories" => "BTC|Exchange|Trading",
536
+ # "lang" => "EN",
537
+ # "source_info" => {
538
+ # "name" => "Bitcoin.com",
539
+ # "lang" => "EN",
540
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoincom.png"
541
+ # }
542
+ # },
543
+ # ...
544
+ # ]
545
+ ```
546
+
547
+ **Example:**
548
+
549
+ Get all the news providers that CryptoCompare has integrated with.
550
+
551
+ ```ruby
552
+ Cryptocompare::News.providers
553
+ # => [
554
+ # {
555
+ # "key" => "cryptocompare",
556
+ # "name" => "CryptoCompare",
557
+ # "lang" => "EN",
558
+ # "img" => "https://images.cryptocompare.com/news/default/cryptocompare.png"
559
+ # },
560
+ # {
561
+ # "key" => "coindesk",
562
+ # "name" => "CoinDesk",
563
+ # "lang" => "EN",
564
+ # "img" => "https://images.cryptocompare.com/news/default/coindesk.png"
565
+ # },
566
+ # {
567
+ # "key" => "bitcoinmagazine",
568
+ # "name" => "Bitcoin Magazine",
569
+ # "lang" => "EN",
570
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoinmagazine.png"
571
+ # },
572
+ # {
573
+ # "key" => "yahoofinance",
574
+ # "name" => "Yahoo Finance Bitcoin",
575
+ # "lang" => "EN",
576
+ # "img" => "https://images.cryptocompare.com/news/default/yahoofinance.png"
577
+ # },
578
+ # ...
579
+ # ]
580
+ ```
581
+
515
582
  ### Exchanges
516
583
  Get exchange data, such as cryptocurrencies that each exchange offers, and the supported conversion cryptocurrencies.
517
584
 
@@ -5,6 +5,7 @@ require_relative "cryptocompare/exchanges"
5
5
  require_relative "cryptocompare/histo_day"
6
6
  require_relative "cryptocompare/histo_hour"
7
7
  require_relative "cryptocompare/histo_minute"
8
+ require_relative "cryptocompare/news"
8
9
  require_relative "cryptocompare/price"
9
10
  require_relative "cryptocompare/price_historical"
10
11
  require_relative "cryptocompare/helpers/query_param_helper"
@@ -0,0 +1,97 @@
1
+ require 'faraday'
2
+ require 'json'
3
+
4
+ module Cryptocompare
5
+ module News
6
+ NEWS_API_URL = 'https://min-api.cryptocompare.com/data/news/'
7
+ NEWS_PROVIDERS_API_URL = 'https://min-api.cryptocompare.com/data/news/providers'
8
+
9
+ # Returns news articles from the providers that CryptoCompare has integrated
10
+ # with.
11
+ #
12
+ # ==== Returns
13
+ #
14
+ # [Array] Array of news article objects.
15
+ #
16
+ # ==== Example
17
+ #
18
+ # Get news articles from the providers that CryptoCompare has integrated
19
+ # with.
20
+ #
21
+ # Cryptocompare::News.all
22
+ #
23
+ # Sample response
24
+ #
25
+ # [
26
+ # {
27
+ # "id" => "85721",
28
+ # "guid" => "https://news.bitcoin.com/?p=127153",
29
+ # "published_on" => 1520834400,
30
+ # "imageurl" => "https://images.cryptocompare.com/news/bitcoin.com/b9MBw3g640c.jpeg",
31
+ # "title" => "Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades",
32
+ # "url" => "https://news.bitcoin.com/study-finds-3b-worth-of-faked-cryptocurrency-volumes-and-wash-trades/",
33
+ # "source" => "bitcoin.com",
34
+ # "body" => "On March 10 a cryptocurrency trader and researcher published a report on how he believes $3 billion worth of cryptocurrency trade volumes, primarily from a couple of exchanges, are concocted. The author of the study, Sylvain Ribes, alleges that the exchange Okcoin has been fabricating up to 93 percent of its trade volumes. Also read: Thailand [&#8 230;]The post Study Finds $3B Worth of Faked Cryptocurrency Volumes and Wash Trades appeared first on Bitcoin News.",
35
+ # "tags" => "News|95%|altcoin exchange|Binance|Bitcoin|BTC|Coinmarketcap|Fake Trades|GDAX|Huobi|illiquid assets|Kraken|Liquidity|Livecoinwatch|N-Featured|OKcoin|Okex|Poloniex|Sylvain Ribes|trading|Volumes|Wash Trades|Zhao Changpeng",
36
+ # "categories" => "BTC|Exchange|Trading",
37
+ # "lang" => "EN",
38
+ # "source_info" => {
39
+ # "name" => "Bitcoin.com",
40
+ # "lang" => "EN",
41
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoincom.png"
42
+ # }
43
+ # },
44
+ # ...
45
+ # ]
46
+ def self.all
47
+ api_resp = Faraday.get(NEWS_API_URL)
48
+ JSON.parse(api_resp.body)
49
+ end
50
+
51
+ # Returns all the news providers that CryptoCompare has integrated with.
52
+ #
53
+ # ==== Returns
54
+ #
55
+ # [Array] Array of news provider objects.
56
+ #
57
+ # ==== Example
58
+ #
59
+ # Get all the news providers that CryptoCompare has integrated with.
60
+ #
61
+ # Cryptocompare::News.providers
62
+ #
63
+ # Sample response
64
+ #
65
+ # [
66
+ # {
67
+ # "key" => "cryptocompare",
68
+ # "name" => "CryptoCompare",
69
+ # "lang" => "EN",
70
+ # "img" => "https://images.cryptocompare.com/news/default/cryptocompare.png"
71
+ # },
72
+ # {
73
+ # "key" => "coindesk",
74
+ # "name" => "CoinDesk",
75
+ # "lang" => "EN",
76
+ # "img" => "https://images.cryptocompare.com/news/default/coindesk.png"
77
+ # },
78
+ # {
79
+ # "key" => "bitcoinmagazine",
80
+ # "name" => "Bitcoin Magazine",
81
+ # "lang" => "EN",
82
+ # "img" => "https://images.cryptocompare.com/news/default/bitcoinmagazine.png"
83
+ # },
84
+ # {
85
+ # "key" => "yahoofinance",
86
+ # "name" => "Yahoo Finance Bitcoin",
87
+ # "lang" => "EN",
88
+ # "img" => "https://images.cryptocompare.com/news/default/yahoofinance.png"
89
+ # },
90
+ # ...
91
+ # ]
92
+ def self.providers
93
+ api_resp = Faraday.get(NEWS_PROVIDERS_API_URL)
94
+ JSON.parse(api_resp.body)
95
+ end
96
+ end
97
+ end
@@ -1,3 +1,3 @@
1
1
  module Cryptocompare
2
- VERSION = "0.13.0"
2
+ VERSION = "0.14.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cryptocompare
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander David Pan
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-08 00:00:00.000000000 Z
11
+ date: 2018-03-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -134,6 +134,7 @@ files:
134
134
  - lib/cryptocompare/histo_day.rb
135
135
  - lib/cryptocompare/histo_hour.rb
136
136
  - lib/cryptocompare/histo_minute.rb
137
+ - lib/cryptocompare/news.rb
137
138
  - lib/cryptocompare/price.rb
138
139
  - lib/cryptocompare/price_historical.rb
139
140
  - lib/cryptocompare/top_pairs.rb