livefyre 1.3.0 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGUyOTkxOWQwN2MzZWRmYTZiMjhlMjhiNTliNTU4NTg2N2M5YjVkYg==
4
+ MTMyOTJlNDUxZTNiZjI0MWJhNjVkNTZlODFkYmRiZjc5NmIxN2EyYg==
5
5
  data.tar.gz: !binary |-
6
- ZTlmOWRlMWU4NTI0NzI5ODM1YmJlN2U1NzkzODA2M2MxMzExOGJmYQ==
6
+ MjdiM2JmM2VkZDk1NDNiOGM3MjBhMTMwNGNjZTMxNjM0NzdiYmE3Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjM4ZWIyMWM2YjdhMzVhMjRiZTI4YTZjMzMwNzNjNjFhZjIwMTFkZDE3OTkx
10
- YmRkZDIzZTY3MjlmOGM4NmY0ZDEzNmMxZDA2YWYyZDBlMmQxZDU0YTg1MzZi
11
- ZGQxNmJlOTA0ZGEwMDBkZGQ0MjNmYzFiOTA4MTg0N2UwNzhmZjE=
9
+ N2U1OGQzOTc1MmQyOTg2Nzc5YmYwMWNmZjQ3MzlmODY2NDE0OGMyOGQzNzg5
10
+ OTA4ZDA4YTU5NWRhMjk5OWZiNGU0ZDEyNzBhMjM5NjI0ZjQ4MDZlY2ZjYTQ4
11
+ NWI3MGViMjcxMzgzOTUyZTBhMDUxODg5NWI0N2YwZDQzYWQ0MDg=
12
12
  data.tar.gz: !binary |-
13
- MmY1NjUwNjk3OTE4Nzc2ZTI4ZWI3MWFkMzFjYmFkZmIwNzJjZGMyMjJiODZh
14
- OGRmNjc2NDlmNDRhODM4N2NhNzgzYmZkZGI5NWQyODdmMGU3ZDQ3YWJiNTcy
15
- OTAxOTZhMTgxYzA3MzA5ODM5N2E5MmI3NmEzNzI4ZmVjODc4MjQ=
13
+ OWY5Y2ZjNjI2YTRjMGZhN2M3ZTk4NTVkZTdlMzM4YmE3ZmQwOGRmZGI5Yzc4
14
+ NjQ5MmQ4MmFkMGY5Y2U5NjEzNTkwODEzNmJlMWVhNDBkNDFlMDlmYjFjOWIw
15
+ MmRiMzBhZjRhOWNlM2U4NjllOTYzYTE0Y2RmYjcyOGY1OWYwOTU=
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ === 1.3.2 2014-08-12
2
+
3
+ * Added SSL toggle for all API requests.
4
+
1
5
  === 1.3.0 2014-07-30
2
6
 
3
7
  *** CAUTION: THIS VERSION HAS UPDATED METHODS THAT MAKE PREVIOUS FUNCTION CALLS OBSOLETE ***
@@ -5,6 +5,7 @@ require 'addressable/uri'
5
5
 
6
6
  require 'livefyre/entity/topic'
7
7
  require 'livefyre/entity/subscription'
8
+ require 'livefyre/api/domain'
8
9
 
9
10
  module Livefyre
10
11
  class PersonalizedStream
@@ -203,7 +204,7 @@ module Livefyre
203
204
 
204
205
  # Stream API
205
206
  def self.get_timeline_stream(core, resource, limit=50, t_until=nil, t_since=nil)
206
- url = STREAM_BASE_URL + TIMELINE_PATH
207
+ url = self.stream_base_url(core) + TIMELINE_PATH
207
208
  url += "?resource=#{resource}&limit=#{limit}"
208
209
 
209
210
  if t_until != nil
@@ -220,10 +221,12 @@ module Livefyre
220
221
  private
221
222
 
222
223
  def self.base_url(core)
223
- "https://#{core.network_name}.quill.fyre.co/api/v4"
224
+ "#{Domain::quill(core)}/api/v4"
224
225
  end
225
226
 
226
- STREAM_BASE_URL = 'https://bootstrap.livefyre.com/api/v4'
227
+ def self.stream_base_url(core)
228
+ "#{Domain::bootstrap(core)}/api/v4"
229
+ end
227
230
 
228
231
  def self.topic_path(core, topic_id)
229
232
  "/#{Topic.generate_urn(core, topic_id)}/"
@@ -3,6 +3,7 @@ require 'jwt'
3
3
  require 'rest-client'
4
4
 
5
5
  require 'livefyre/core/site'
6
+ require 'livefyre/api/domain'
6
7
 
7
8
  module Livefyre
8
9
  class Network
@@ -12,18 +13,20 @@ module Livefyre
12
13
  def initialize(name, key)
13
14
  @name = name
14
15
  @key = key
16
+ @ssl = true
15
17
  @network_name = name.split('.')[0]
16
18
  end
17
19
 
18
20
  attr_reader :name
19
21
  attr_reader :key
22
+ attr_accessor :ssl
20
23
  attr_reader :network_name
21
24
 
22
25
  def set_user_sync_url(url_template)
23
26
  raise ArgumentError, 'url_template should contain {id}' if !url_template.include?('{id}')
24
27
 
25
28
  response = RestClient.post(
26
- "http://#{@name}",
29
+ "#{Domain::quill(self)}/",
27
30
  { actor_token: build_livefyre_token, pull_profile_url: url_template }
28
31
  )
29
32
  response.code == 204
@@ -31,7 +34,7 @@ module Livefyre
31
34
 
32
35
  def sync_user(user_id)
33
36
  response = RestClient.post(
34
- "http://#{@name}/api/v3_0/user/#{user_id}/refresh",
37
+ "#{Domain::quill(self)}/api/v3_0/user/#{user_id}/refresh",
35
38
  { lftoken: build_livefyre_token }
36
39
  )
37
40
  response.code == 200
@@ -5,6 +5,8 @@ require 'jwt'
5
5
  require 'rest-client'
6
6
  require 'addressable/uri'
7
7
 
8
+ require 'livefyre/api/domain'
9
+
8
10
  module Livefyre
9
11
  class Site
10
12
  TYPE = %w(reviews sidenotes ratings counting liveblog livechat livecomments)
@@ -46,7 +48,7 @@ module Livefyre
46
48
 
47
49
 
48
50
  def create_collection(title, article_id, url, options={})
49
- uri = "https://#{network_name}.quill.fyre.co/api/v3.0/site/#{@id}/collection/create/?sync=1"
51
+ uri = "#{Domain::quill(self)}/api/v3.0/site/#{@id}/collection/create/?sync=1"
50
52
  data = {
51
53
  articleId: article_id,
52
54
  collectionMeta: build_collection_meta_token(title, article_id, url, options),
@@ -65,7 +67,7 @@ module Livefyre
65
67
 
66
68
  def get_collection_content(article_id)
67
69
  response = RestClient.get(
68
- "https://bootstrap.livefyre.com/bs3/#{@network.name}/#{@id}/#{Base64.encode64(article_id.to_s).chomp}/init",
70
+ "#{Domain::bootstrap(self)}/bs3/#{@network.name}/#{@id}/#{Base64.encode64(article_id.to_s).chomp}/init",
69
71
  :accepts => :json
70
72
  )
71
73
  response.code == 200 ? JSON.parse(response) : nil
@@ -1,3 +1,3 @@
1
1
  module Livefyre
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: livefyre
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Livefyre
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-06 00:00:00.000000000 Z
11
+ date: 2014-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler