greentext 0.2.0 → 0.3.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: 70e6ce509e15bac2d2e63dad243d7ce386d7cffb
4
- data.tar.gz: 8fa2485f164f343aa72540210285c378d33cc901
3
+ metadata.gz: c7ba122616e32e4f72fcf28eece5496993aca498
4
+ data.tar.gz: 301ad86a4d16613ded9a9a9e43a4cdd0b2018289
5
5
  SHA512:
6
- metadata.gz: 08ac112408c79420c2cda4af93caeca85ea4ee1587e06f4dd517db646b36d7e2cfe5203b3f3370aead01288213fdc15f939b5129da79cb2defd3a0c58ad430d9
7
- data.tar.gz: 603b286fe5603f64b871717a3b944fdf3843318f0763af5b9036c94305935374927b78b43a52a9dc320d117155b167458d8638447bd54b0cdc4154aa41857d5b
6
+ metadata.gz: 8af2f6b6277a4acc059445cf6735347e7946bfbed47d5c7dc1e39b9c622306fbf3bd5cf5055f56f7665f59ac7c6f11b61634963afff55401fe6f4229426d8568
7
+ data.tar.gz: f7fe8d1809779ba7b6b437e7a453479802402486a01d630c1e9b7b0bed96976c67718a10ef4e0f75cd4fd90d43f685702b50785054f42dc736b3437c96cde8c9
data/greentext.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "greentext"
5
- s.version = "0.2.0"
5
+ s.version = "0.3.0"
6
6
  s.authors = ["Avinash Dwarapu"]
7
7
  s.email = ["d.nash.avi@gmail.com"]
8
8
  s.summary = %q{Unofficial API for 4chan.}
@@ -8,5 +8,9 @@ module Greentext
8
8
  attr_reader :posts_per_page, :per_page
9
9
  attr_reader :pages
10
10
  attr_predicate :worksafe, :ws_board
11
+
12
+ def threads
13
+ Greentext.client.threads(self)
14
+ end
11
15
  end
12
16
  end
@@ -4,7 +4,7 @@ module Greentext
4
4
  class Client
5
5
  # Internal: Methods for interacting with posts
6
6
  module Post
7
- # Public: Get the replies to a Greentext::Post object.
7
+ # Public: Get the expanded threads given a Greentext::Post object.
8
8
  # This will only work if the post is OP.
9
9
  #
10
10
  # post - a Greentext::Post object.
@@ -13,7 +13,6 @@ module Greentext
13
13
  def expand(post)
14
14
  if post.op?
15
15
  posts = get("/#{post.board.name}/res/#{post.no}.json")["posts"]
16
- posts.shift # Remove OP's post
17
16
  posts.map do |params|
18
17
  params.merge!("board" => post.board)
19
18
  Greentext::Post.new(params)
@@ -62,5 +62,9 @@ module Greentext
62
62
  def op?
63
63
  @attrs["resto"] == 0
64
64
  end
65
+
66
+ def expand
67
+ Greentext.client.expand(self)
68
+ end
65
69
  end
66
70
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greentext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avinash Dwarapu