wreddit 1.1.2 → 1.1.3

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: 760fddb85005b35720778c70127079a95d7c4ebe
4
- data.tar.gz: 4fc6dce87175ecba6c3475c9bc187bcc226e06fe
3
+ metadata.gz: 21c56dbe3a3be68cad2ad9ba317b49c04203acfc
4
+ data.tar.gz: 95a3377b29f22b2948099e9700ab08d52b2bc7b2
5
5
  SHA512:
6
- metadata.gz: e9de36c68b463825c2ada5caba6b3db5f496e09b8f123590833a788f836b7f2eba2fd340c2b525c457f7d4e24c23ddbcd518f87ed4d09e614e711998819eebed
7
- data.tar.gz: 8d1f25e8f669e41dc691154a7e0222626a566a5ff8aa04d669ff79ec5c18dbee004408dffc1aab741d1da955fa66a1d5049bea1d68b068c8939cee46e9cbea0a
6
+ metadata.gz: 3207ab3ed372fdc6949faa027cf020f8635aa7a5151c1c3c12ca6a61d413e306b4deb63bc8de8a53bfe7b7d747ad7912b81a9a833f89a0cf39ecd8ff334c4d17
7
+ data.tar.gz: d56b2447ee25646cc4d9e5f87e14a0042cf8c3f81d96a52d057700a805fb73f1dbc3e697e8ca6c3745eb645269e1d665026ea3e5bf84e26f50fe73ff42ecf5ed
data/lib/wreddit.rb CHANGED
@@ -44,7 +44,12 @@ class Wreddit
44
44
  # unique parsing (currently only works in JSON)
45
45
  def links
46
46
  links = []
47
- response = JSON.parse(self.json)
47
+ begin
48
+ response = JSON.parse(self.json)
49
+ begin
50
+ rescue JSON::ParserError, TypeError => e
51
+ puts e
52
+ end
48
53
  unless response['data']['children'].nil?
49
54
  response['data']['children'].each do |child|
50
55
  links.push(child['data']['url'])
@@ -57,7 +62,12 @@ class Wreddit
57
62
 
58
63
  def titles
59
64
  titles = []
60
- response = JSON.parse(self.json)
65
+ begin
66
+ response = JSON.parse(self.json)
67
+ begin
68
+ rescue JSON::ParserError, TypeError => e
69
+ puts e
70
+ end
61
71
  unless response['data']['children'].nil?
62
72
  response['data']['children'].each do |child|
63
73
  titles.push(child['data']['title'])
@@ -70,7 +80,12 @@ class Wreddit
70
80
 
71
81
  def descriptions
72
82
  descriptions = []
73
- response = JSON.parse(self.json)
83
+ begin
84
+ response = JSON.parse(self.json)
85
+ begin
86
+ rescue JSON::ParserError, TypeError => e
87
+ puts e
88
+ end
74
89
  unless response['data']['children'].nil?
75
90
  response['data']['children'].each do |child|
76
91
  descriptions.push(child['data']['selftext'])
@@ -1,3 +1,3 @@
1
1
  class Wreddit
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wreddit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Hulse