bwkfanboy 1.3.2 → 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.
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
- quora 13 Last n answers (per-user) from Quora; requires nodejs 0.3.7+
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 = 'A converter from HTML to Atom feed that you can use to watch sites that do not provide its own feed.'
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
@@ -105,6 +105,7 @@ case $conf[:mode]
105
105
  when 'template'
106
106
  require 'erb'
107
107
  require 'digest/md5'
108
+ require 'etc'
108
109
 
109
110
  t = ERB.new(File.read($conf[:skeleton]))
110
111
  t.filename = $conf[:skeleton] # to report errors relative to this file
data/doc/NEWS.rdoc CHANGED
@@ -1,3 +1,13 @@
1
+ === 1.4.0
2
+
3
+ Wed Apr 6 23:45:39 EEST 2011
4
+
5
+ - A new plugin: articles (per-user) from inc.com.
6
+
7
+ - Removed quora plugin.
8
+
9
+ - Fixed a but with '-t' command line option.
10
+
1
11
  === 1.3.2
2
12
 
3
13
  Mon Mar 28 12:13:31 EEST 2011
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
- quora 13 Last n answers (per-user) from Quora; requires nodejs 0.3.7+
20
+ inc 1 Articles (per-user) from inc.com
21
21
  econlib 1 Latest articles from econlib.org
22
22
 
23
23
 
@@ -1,6 +1,6 @@
1
1
  module Bwkfanboy
2
2
  module Meta
3
3
  NAME = 'bwkfanboy'
4
- VERSION = '1.3.2'
4
+ VERSION = '1.4.0'
5
5
  end
6
6
  end
@@ -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