producthunt 0.1.0 → 0.1.1

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.
Files changed (3) hide show
  1. checksums.yaml +8 -8
  2. data/lib/producthunt.rb +21 -6
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTIxMzg5MmY2YjQzNmI0Y2Q0MjNjYmRjYWIyZDZhZTczZDIyNTFhYg==
4
+ ZmQ0MjFmMzhlMGZjNjkxN2EwNzIwZGU5OGE2NzcyMGNkNWY3NjA4Mg==
5
5
  data.tar.gz: !binary |-
6
- MTgwOTVjNWUwMGRlNjRlYzMzMjliZWJkY2E4MTkyZDhiM2M2Yjg2ZA==
6
+ ZDkxMWQxZTc1MDllZGQyZTM4YjU3NDAyZWQwYThlOGE1ZTJmODZmZg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmIzMzU1ZjgxNGJkNWIxYjYwOTk1OWZlMzAxNjBmOTFjMjEzNzc1MDIyNmU3
10
- N2RiNDEyMTgxYmE5YTNlMjIxYWNjNGE4ZDE3MzJhNjljNTk5NjlmMDZlNTNi
11
- MmYxNjVmYTQyOGFhZGE2ODZjYWFlNGYxYjYyZjA2YjBjMTUyMzA=
9
+ Y2I0YjJjNzgzNGZhYzJlZDQyOTNlOTZjZDMwMjkzOGEyY2JjNTM2MjEzYzNi
10
+ ZDAxZDVlZmMyYzQ1OTI3ZWM1NTVlMmQ3ZDY2NjQ1NDZmNjk4YjE2MDY4ZjA4
11
+ MWE3NWE0MWRiM2M3YmRlYWZiMWY0ZDdjZTYwOTc0NTgyMDcwM2M=
12
12
  data.tar.gz: !binary |-
13
- Mjk1MWNmMjk2OTE0ZDc1ZjA5ZjA2N2IwYWUyOGYyNWE4YWRiZDRlNmJlNTNh
14
- ZjU4OWNjZjU0NzQ1MmI5NmI5ODViMTQ2YWVhNTZlOTIwYWVjYTA1OWYxNTg2
15
- YzJlNjE4ZTA5N2QyMDcxOTIxYWIwODc2MGI3ZWYwNWRjNTRiZDA=
13
+ NTZlMjE3YjFiOWEwZjA1OWIyZDA1MWZkYmE0NjEwNmY3ZmNmNTg3MWE3NzI5
14
+ ODZmMTQ5ZDU0ZjgzM2NjNTVhYzQ3MDYwMGM5ZmI1MDU4MDc5YmY1NDFiOWQy
15
+ ZDUwNzY3YTk5YzlmM2UzNTdmMjM0MjY2YWUxNmFmNzAwODg2NDA=
data/lib/producthunt.rb CHANGED
@@ -7,9 +7,15 @@ module ProductHunt
7
7
  # Get today's products
8
8
  #
9
9
  # Example:
10
- # >> posts = ProductHunt::Post.get_today
11
- # >> puts posts.inspect
12
- # => [{"title"=>"Wealthfront", "votes"=>10, "user"=>{"username"=>"hunterwalk", "name"=>"Hunter Walk"}, "rank"=>2, "tagline"=>"Automated, low cost investment service", "comment_count"=>"3", "permalink"=>"/posts/wealthfront", "url"=>"https://www.wealthfront.com/"}, ... ]
10
+ # >> puts ProductHunt::Post.get_today
11
+ # => { "status"=>"success",
12
+ # "hunts"=>[
13
+ # {
14
+ # "title"=>"Wealthfront", "votes"=>10,
15
+ # "user"=>{"username"=>"hunterwalk", "name"=>"Hunter Walk"},
16
+ # "rank"=>2, "tagline"=>"Automated, low cost investment service",
17
+ # "comment_count"=>"3", "permalink"=>"/posts/wealthfront", "url"=>"https://www.wealthfront.com/"
18
+ # }, ... ]}
13
19
  def self.get_today
14
20
  url = "http://hook-api.herokuapp.com/today"
15
21
  res = RestClient.get url
@@ -19,9 +25,18 @@ module ProductHunt
19
25
  # Get comments for any post
20
26
  #
21
27
  # Example:
22
- # >> comments = ProductHunt::Post.get_comments("/posts/splashbase")
23
- # >> puts comments
24
- # => {"status"=>"success", "post"=>{"title"=>"Wealthfront", "votes"=>10, "user"=>{"username"=>"hunterwalk", "name"=>"Hunter Walk"}, "rank"=>1, "tagline"=>"Automated, low cost investment service", "comment_count"=>"3", "permalink"=>"/posts/wealthfront", "url"=>"https://www.wealthfront.com/"}, "comments"=>[{"index"=>1, "user"=>{"username"=>"hunterwalk", "name"=>"Hunter Walk"}, "timestamp"=>"6h ago", "comment"=>"\n \n CEO is the awesome @adamnash - maybe he'll leap in here and answer any questions\n ", "comment_html"=>"\n \n CEO is the awesome <a href=\"https://twitter.com/adamnash\">@adamnash</a> - maybe he'll leap in here and answer any questions\n "}, ...
28
+ # >> puts ProductHunt::Post.get_comments("/posts/splashbase")
29
+ # => { "status"=>"success",
30
+ # "post"=>{
31
+ # "title"=>"Wealthfront", "votes"=>10,
32
+ # "user"=>{"username"=>"hunterwalk", "name"=>"Hunter Walk"},
33
+ # "rank"=>1, "tagline"=>"Automated, low cost investment service", "comment_count"=>"3", "permalink"=>"/posts/wealthfront", "url"=>"https://www.wealthfront.com/"},
34
+ # "comments"=>[
35
+ # {
36
+ # "index"=>1, "user"=>{"username"=>"hunterwalk", "name"=>"Hunter Walk"}, "timestamp"=>"6h ago",
37
+ # "comment"=>"\n\nCEO is the awesome @adamnash - maybe he'll leap in here and answer any questions\n",
38
+ # "comment_html"=>"\n\nCEO is the awesome <a href=\"https://twitter.com/adamnash\">@adamnash</a> - maybe he'll leap in here and answer any questions\n"
39
+ # }, ... ]}}
25
40
  #
26
41
  # Arguments:
27
42
  # permalink: (String)
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: producthunt
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
- - D
7
+ - dugong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
@@ -39,7 +39,7 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.6.7
41
41
  description: ProductHunt gem for Hook ProductHunt REST API.
42
- email: demo@rubygems.org
42
+ email: dugong926@gmail.com
43
43
  executables: []
44
44
  extensions: []
45
45
  extra_rdoc_files: []
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project:
68
- rubygems_version: 2.2.2
68
+ rubygems_version: 2.3.0
69
69
  signing_key:
70
70
  specification_version: 4
71
71
  summary: ProductHunt gem for Hook ProductHunt REST API.