ruby2ch 0.1.1 → 0.1.2

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.
@@ -8,6 +8,7 @@ module Ruby2ch
8
8
  class Board
9
9
  def initialize(url)
10
10
  @agent = Mechanize.new
11
+ url = url + "subback.html"
11
12
  @page = @agent.get(url)
12
13
  @links = @page.links.map{|link| [link.href,link.text]}#.map{|link| link.split("/")[0]}
13
14
 
@@ -1,6 +1,7 @@
1
1
  #encoding: utf-8
2
2
  require 'mechanize'
3
3
  require 'kconv'
4
+ require 'Time'
4
5
  module Ruby2ch
5
6
  class Dat
6
7
  def initialize(url,title)
@@ -37,6 +38,14 @@ module Ruby2ch
37
38
  res_array = res.scan(/(^\S+)\<\/b\>(\(.*\))\<b\>\<\>\S*\<\>(.+)\sID:(\S+)\s*(BE.*)*\<\>\s(\<a.*\<\/a\>)*(.*)/)
38
39
  end
39
40
 
41
+ def create_thread
42
+ return @thre[0][:date]
43
+ end
44
+
45
+ def impetus
46
+ return @thre.size/(Time.now - Time.parse(create_thread )) * 60 * 60 * 24
47
+ end
48
+
40
49
 
41
50
 
42
51
  attr_accessor :dat_url,:page,:thre,:title
@@ -1,3 +1,3 @@
1
1
  module Ruby2ch
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby2ch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-25 00:00:00.000000000 +09:00
13
- default_executable:
12
+ date: 2011-11-25 00:00:00.000000000Z
14
13
  dependencies: []
15
14
  description: 2ch for ruby
16
15
  email:
@@ -30,7 +29,6 @@ files:
30
29
  - lib/ruby2ch/thre.rb
31
30
  - lib/ruby2ch/version.rb
32
31
  - ruby2ch.gemspec
33
- has_rdoc: true
34
32
  homepage: ''
35
33
  licenses: []
36
34
  post_install_message:
@@ -51,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
49
  version: '0'
52
50
  requirements: []
53
51
  rubyforge_project: ruby2ch
54
- rubygems_version: 1.6.2
52
+ rubygems_version: 1.8.10
55
53
  signing_key:
56
54
  specification_version: 3
57
55
  summary: 2ch for ruby