vbulletin 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/vbulletin/forum.rb +4 -12
- data/lib/vbulletin/search.rb +5 -1
- data/lib/vbulletin/thread.rb +1 -1
- data/vbulletin.gemspec +1 -1
- metadata +3 -3
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = "lloydpick@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/lloydpick/vbulletin"
|
12
12
|
gem.authors = ["Lloyd Pick"]
|
13
|
-
gem.version = '0.0.
|
13
|
+
gem.version = '0.0.5'
|
14
14
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
15
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
16
|
gem.add_dependency('mechanize', '1.0.0')
|
data/lib/vbulletin/forum.rb
CHANGED
@@ -1,19 +1,11 @@
|
|
1
1
|
module VBulletin
|
2
2
|
class Forum < Base
|
3
3
|
|
4
|
-
|
5
|
-
@api = api
|
6
|
-
@debug = options[:debug] || false
|
7
|
-
end
|
8
|
-
|
9
|
-
def all
|
10
|
-
parse_index(@api.construct_full_url("index.php"))
|
11
|
-
end
|
4
|
+
attr_reader :id, :name
|
12
5
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
puts result.body
|
6
|
+
def initialize(*params)
|
7
|
+
params.each do |key|
|
8
|
+
key.each { |k, v| instance_variable_set("@#{k}", v) }
|
17
9
|
end
|
18
10
|
end
|
19
11
|
|
data/lib/vbulletin/search.rb
CHANGED
@@ -17,7 +17,11 @@ module VBulletin
|
|
17
17
|
thread_id = CGI.parse(URI.parse(thread_link['href']).query)['t'][0]
|
18
18
|
thread_author = result.search('//td[@class="page"]/table/tr/td').first
|
19
19
|
thread_created_at = result.search('//td[@class="page"]/table/tr/td[@class="smallfont"]').first.inner_html
|
20
|
-
|
20
|
+
forum = result.links_with(:href => /forumdisplay.php/).first
|
21
|
+
thread_forum_name = forum.text
|
22
|
+
thread_forum_id = CGI.parse(URI.parse(forum.href).query)['f'][0]
|
23
|
+
forum = VBulletin::Forum.new(:id => thread_forum_id, :name => thread_forum_name)
|
24
|
+
VBulletin::Thread.new(:id => thread_id, :title => thread_title, :created_at => thread_created_at, :forum => forum)
|
21
25
|
end
|
22
26
|
end
|
23
27
|
|
data/lib/vbulletin/thread.rb
CHANGED
data/vbulletin.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vbulletin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Lloyd Pick
|