bwkfanboy 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/Rakefile +1 -2
- data/bin/bwkfanboy +1 -0
- data/doc/NEWS.rdoc +10 -0
- data/doc/README.rdoc +1 -1
- data/lib/bwkfanboy/meta.rb +1 -1
- data/lib/bwkfanboy/plugins/inc.rb +37 -0
- data/test/semis/inc.html +1067 -0
- data/test/semis/links.txt +1 -1
- data/test/test_server.rb +13 -12
- metadata +64 -99
- data/lib/bwkfanboy/plugins/quora.js +0 -111
- data/lib/bwkfanboy/plugins/quora.rb +0 -81
- data/test/semis/quora.html +0 -45
data/README.rdoc
CHANGED
@@ -17,7 +17,7 @@ plugin.)
|
|
17
17
|
|
18
18
|
bwk 2 Brian Kernighan's articles from Daily Princetonian
|
19
19
|
freebsd-ports-update 3 News from FreeBSD ports
|
20
|
-
|
20
|
+
inc 1 Articles (per-user) from inc.com
|
21
21
|
econlib 1 Latest articles from econlib.org
|
22
22
|
|
23
23
|
|
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ require_relative 'doc/rakefile'
|
|
12
12
|
|
13
13
|
spec = Gem::Specification.new {|i|
|
14
14
|
i.name = "bwkfanboy"
|
15
|
-
i.summary =
|
15
|
+
i.summary = "#{i.name} is a converter from a raw HTML to an Atom feed. You can use it to watch sites that do not provide its own feed."
|
16
16
|
i.description = i.summary
|
17
17
|
i.version = `bin/#{i.name} -V`
|
18
18
|
i.author = 'Alexander Gromnitsky'
|
@@ -23,7 +23,6 @@ spec = Gem::Specification.new {|i|
|
|
23
23
|
i.files = git_ls('.')
|
24
24
|
|
25
25
|
i.executables = FileList['bin/*'].gsub(/^bin\//, '')
|
26
|
-
i.default_executable = i.name
|
27
26
|
|
28
27
|
i.test_files = FileList['test/test_*.rb']
|
29
28
|
|
data/bin/bwkfanboy
CHANGED
data/doc/NEWS.rdoc
CHANGED
data/doc/README.rdoc
CHANGED
@@ -17,7 +17,7 @@ plugin.)
|
|
17
17
|
|
18
18
|
bwk 2 Brian Kernighan's articles from Daily Princetonian
|
19
19
|
freebsd-ports-update 3 News from FreeBSD ports
|
20
|
-
|
20
|
+
inc 1 Articles (per-user) from inc.com
|
21
21
|
econlib 1 Latest articles from econlib.org
|
22
22
|
|
23
23
|
|
data/lib/bwkfanboy/meta.rb
CHANGED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Requires 1 option: an author's name, for example 'jason-fried'.
|
2
|
+
|
3
|
+
require 'nokogiri'
|
4
|
+
|
5
|
+
class Page < Bwkfanboy::Parse
|
6
|
+
module Meta
|
7
|
+
URI = 'http://www.inc.com/author/#{opt[0]}'
|
8
|
+
URI_DEBUG = '/home/alex/lib/software/alex/bwkfanboy/test/semis/inc.html'
|
9
|
+
ENC = 'UTF-8'
|
10
|
+
VERSION = 1
|
11
|
+
COPYRIGHT = 'See bwkfanboy\'s LICENSE file'
|
12
|
+
TITLE = "Articles (per-user) from inc.com"
|
13
|
+
CONTENT_TYPE = 'html'
|
14
|
+
end
|
15
|
+
|
16
|
+
def myparse(stream)
|
17
|
+
profile = opt[0]
|
18
|
+
|
19
|
+
# read 'stream' IO object and parse it
|
20
|
+
doc = Nokogiri::HTML(stream, nil, Meta::ENC)
|
21
|
+
doc.xpath("//div[@id='articleriver']/div/div").each {|i|
|
22
|
+
t = clean(i.xpath("h3").text)
|
23
|
+
l = clean(i.xpath("h3/a")[0].attributes['href'].value)
|
24
|
+
|
25
|
+
next if (u = i.xpath("div[@class='byline']/span")).size == 0
|
26
|
+
u = date(u.text)
|
27
|
+
|
28
|
+
a = clean(i.xpath("div[@class='byline']/a").text)
|
29
|
+
|
30
|
+
c = i.xpath("p[@class='summary']")
|
31
|
+
c.xpath("a").remove
|
32
|
+
c = c.inner_html(encoding: Meta::ENC)
|
33
|
+
|
34
|
+
self << { title: t, link: l, updated: u, author: a, content: c }
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|