ruby-hackernews 1.3.7 → 1.4.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: a75ae2b32c9d840dd595bb25dfde7ca86364fecd
4
- data.tar.gz: 3b125a1e73964ed58d0c1f7c51c105c667f08a2c
3
+ metadata.gz: f48014b00147c10a872eabab64e2c1514ac67f23
4
+ data.tar.gz: c8dad359b0c07c43e4e22272df143c1da0fcfaa7
5
5
  SHA512:
6
- metadata.gz: e014746411f77467c3f4bd70a82acfab27d93b5e5713c5552029ed3f9df85db1dac81f8a97cb6189501d0ec1053a7b6033bbee2586a59fcf36805003f61fba7d
7
- data.tar.gz: 8132a51491bf5b966810d5cf7ec00a203f2c54dece9d5dd9b3209ea89426bd6637ab81fe405671e57fe7b4cc8e409707bde1609848fef75801fc21ede64f268d
6
+ metadata.gz: 5edccf9e5df807bb7b1b65bf902a80553d4d2c8cebe615e87d999ed6b6061545bfe88b8aeb61732c4cfa999c35901fab7dc5d62711c50042b46154509a3f9a71
7
+ data.tar.gz: 1769d51cf5bb8c7889375eae78fd66df951fec39e0cd1a84a28fe829ee5dad7700ff01815dde62871ba3989b950aeb0e176e02e9d36378c87d5ae649a931df74
data/README.rdoc CHANGED
@@ -35,7 +35,7 @@ You can provide a number of pages:
35
35
 
36
36
  There are methods for getting specific entry types:
37
37
 
38
- Entry.questions # gets the first page of questions (ask NH)
38
+ Entry.questions # gets the first page of questions (ask HN)
39
39
  Entry.newest # gets the first page of new links (new)
40
40
  Entry.jobs # gets the first page of job offerts (jobs)
41
41
  Entry.shows # gets the first page of shows (show HN)
@@ -90,7 +90,7 @@ Note that the method above will send a request to HN. If you just need the comme
90
90
 
91
91
  and
92
92
 
93
- entry.comment_url
93
+ entry.comments_url
94
94
 
95
95
  Either of which will not issue a request to HN's site.
96
96
 
@@ -174,3 +174,5 @@ Will return the HN comment url of the last submitted story of that user
174
174
  - Girish Sonawane ( https://github.com/girishso) for adding Entry#shows and Entry#new_shows methods
175
175
  - Niels Van Aken ( https://github.com/nvaken ) for a bugfix in EntryPageParser
176
176
  - Pedro Lambert ( https://github.com/p-lambert ) for fixing bugs and improving structure of CommentInfoParser, TimeInfoParser and UserInfoParser
177
+ - FreedomBen ( https://github.com/FreedomBen ) for fixing a typo in the readme
178
+ - Davide Santangelo ( https://github.com/davidesantangelo ) for reporting a bug related to jobs and show HN entries
@@ -14,7 +14,11 @@ module RubyHackernews
14
14
  @user = user
15
15
  @time = time
16
16
  @comments_info = comments
17
- @cache = PageFetcher.new(@comments_info.page) if @comments_info
17
+ if @comments_info
18
+ @cache = PageFetcher.new(@comments_info.page)
19
+ else
20
+ @cache = PageFetcher.new(@link.href)
21
+ end
18
22
  end
19
23
 
20
24
  def text
@@ -13,6 +13,9 @@ module RubyHackernews
13
13
  next_url = nil
14
14
  pages.times do
15
15
  lines = parser.get_lines
16
+ while lines.first["class"] != "athing"
17
+ lines.shift
18
+ end
16
19
  (lines.length / 2).times do
17
20
  entry_infos << EntryParser.new(lines.shift, lines.shift).parse
18
21
  end
@@ -8,8 +8,8 @@ module RubyHackernews
8
8
  login_url = page.search(".pagetop/a").last['href'].sub("/","")
9
9
  login_page = agent.get(ConfigurationService.base_url + login_url)
10
10
  form = login_page.forms.first
11
- form.u = username
12
- form.p = password
11
+ form.acct = username
12
+ form.pw = password
13
13
  page = form.submit
14
14
  return page.title != nil
15
15
  end
@@ -9,8 +9,8 @@ module RubyHackernews
9
9
  login_url = page.search(".pagetop/a").last['href'].sub("/","")
10
10
  login_page = agent.get(ConfigurationService.base_url + login_url)
11
11
  form = login_page.forms[1]
12
- form.u = username
13
- form.p = password
12
+ form.acct = username
13
+ form.pw = password
14
14
  page = form.submit
15
15
  return page.title != nil
16
16
  end
@@ -1,3 +1,3 @@
1
1
  module RubyHackernews
2
- VERSION = "1.3.7"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-hackernews
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrea Dallera
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-28 00:00:00.000000000 Z
11
+ date: 2016-02-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.0.0
142
+ rubygems_version: 2.4.8
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: An interface to Hacker News