bwkfanboy 1.2.5 → 1.2.7
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.
- data/Rakefile +3 -2
- data/doc/NEWS.rdoc +4 -0
- data/lib/bwkfanboy/plugins/quora.js +2 -0
- data/lib/bwkfanboy/plugins/quora.rb +17 -4
- data/lib/bwkfanboy/utils.rb +1 -1
- data/test/semis/quora.html +10 -10
- data/test/test_server.rb +1 -1
- metadata +8 -8
data/Rakefile
CHANGED
@@ -9,6 +9,7 @@ require 'rake/testtask'
|
|
9
9
|
spec = Gem::Specification.new() {|i|
|
10
10
|
i.name = "bwkfanboy"
|
11
11
|
i.summary = 'A converter from HTML to Atom feed that you can use to watch sites that do not provide its own feed.'
|
12
|
+
i.description = i.summary
|
12
13
|
i.version = `bin/#{i.name} -V`
|
13
14
|
i.author = 'Alexander Gromnitsky'
|
14
15
|
i.email = 'alexander.gromnitsky@gmail.com'
|
@@ -25,8 +26,8 @@ spec = Gem::Specification.new() {|i|
|
|
25
26
|
i.rdoc_options << '-m' << 'doc/README.rdoc' << '-x' << 'plugins'
|
26
27
|
i.extra_rdoc_files = FileList['doc/*']
|
27
28
|
|
28
|
-
i.add_dependency('activesupport', '>= 3.0.
|
29
|
-
i.add_dependency('nokogiri', '>= 1.4.
|
29
|
+
i.add_dependency('activesupport', '>= 3.0.3')
|
30
|
+
i.add_dependency('nokogiri', '>= 1.4.4')
|
30
31
|
i.add_dependency('open4', '>= 1.0.1')
|
31
32
|
i.add_dependency('jsonschema', '>= 2.0.0')
|
32
33
|
}
|
data/doc/NEWS.rdoc
CHANGED
@@ -88,6 +88,8 @@ function prepare4eval(body) {
|
|
88
88
|
"function UserFollowLink(args) { return arr(arguments) }\n" +
|
89
89
|
"function FlashClient(args) { return arr(arguments) }\n" +
|
90
90
|
"function AddQuestionLink(args) { return arr(arguments) }\n" +
|
91
|
+
"function QTextImageEnlarger(args) { return arr(arguments) }\n" +
|
92
|
+
"function NavigatorResults(args) { return arr(arguments) }\n" +
|
91
93
|
'';
|
92
94
|
var tail = "\n_components;\n";
|
93
95
|
|
@@ -17,7 +17,7 @@ class Page < Bwkfanboy::Parse
|
|
17
17
|
URI = 'http://www.quora.com/#{opt[0]}/answers'
|
18
18
|
URI_DEBUG = '/home/alex/lib/software/alex/bwkfanboy/test/semis/quora.html'
|
19
19
|
ENC = 'UTF-8'
|
20
|
-
VERSION =
|
20
|
+
VERSION = 9
|
21
21
|
COPYRIGHT = "See bwkfanboy's LICENSE file"
|
22
22
|
TITLE = "Last n answers (per-user) from Quora; requires nodejs"
|
23
23
|
CONTENT_TYPE = 'html'
|
@@ -37,9 +37,22 @@ class Page < Bwkfanboy::Parse
|
|
37
37
|
if Bwkfanboy::Utils.cfg[:verbose] >= 3
|
38
38
|
File.open("#{File.basename(__FILE__)}-epoch.js.raw", "w+") {|i| i.puts js }
|
39
39
|
end
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
# open a pipe, write js to it & read a JSON result
|
41
|
+
r = ''
|
42
|
+
begin
|
43
|
+
pipe = IO.popen("#{File.dirname(__FILE__)}/quora.js", 'w+')
|
44
|
+
pipe.puts js
|
45
|
+
pipe.close_write
|
46
|
+
while line = pipe.gets
|
47
|
+
r << line
|
48
|
+
end
|
49
|
+
pipe.close
|
50
|
+
rescue
|
51
|
+
fail "evaluation in nodejs failed: #{$!}"
|
52
|
+
end
|
53
|
+
# r = Bwkfanboy::Utils.cmd_run("echo '#{js}' | #{File.dirname(__FILE__)}/quora.js")
|
54
|
+
# fail "evaluation in nodejs failed: #{r[1]}" if r[0] != 0
|
55
|
+
tstp = JSON.parse r
|
43
56
|
break
|
44
57
|
end
|
45
58
|
}
|
data/lib/bwkfanboy/utils.rb
CHANGED
@@ -7,7 +7,7 @@ require 'active_support/core_ext/module/attribute_accessors'
|
|
7
7
|
module Bwkfanboy
|
8
8
|
module Meta
|
9
9
|
NAME = 'bwkfanboy'
|
10
|
-
VERSION = '1.2.
|
10
|
+
VERSION = '1.2.7'
|
11
11
|
USER_AGENT = "#{NAME}/#{VERSION} (#{RUBY_PLATFORM}; N; #{Encoding.default_external.name}; #{RUBY_ENGINE}; rv:#{RUBY_VERSION}.#{RUBY_PATCHLEVEL})"
|
12
12
|
PLUGIN_CLASS = 'Page'
|
13
13
|
DIR_TMP = "/tmp/#{Meta::NAME}/#{ENV['USER']}"
|