boilerpipe 0.0.1 → 0.0.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.
Files changed (3) hide show
  1. data/boilerpipe.gemspec +2 -2
  2. data/lib/boilerpipe.rb +6 -6
  3. metadata +4 -4
data/boilerpipe.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "boilerpipe"
3
- s.version = "0.0.1"
4
- s.date = "2010-05-13"
3
+ s.version = "0.0.2"
4
+ s.date = "2010-05-15"
5
5
  s.summary = "Ruby wrapper of the Boilerpipe API"
6
6
  s.email = "g.marcilhacy@gmail.com"
7
7
  s.homepage = "https://github.com/gregorym/boilerpipe"
data/lib/boilerpipe.rb CHANGED
@@ -11,14 +11,14 @@ class Object
11
11
  end
12
12
 
13
13
  module Boilerpipe
14
- DEFAULT_API_URL = 'http://boilerpipe-web.appspot.com/extract'
15
- EXTRACTORS = [ :ArticleExtractor, :DefaultExtractor, :LargestContentExtractor, :KeepEverythingExtractor, :CanolaExtractor ]
16
- OUTPUT_FORMATS = [ :html, :htmlFragment, :text, :json, :debug ]
14
+ BP_DEFAULT_API_URL = 'http://boilerpipe-web.appspot.com/extract'
15
+ BP_EXTRACTORS = [ :ArticleExtractor, :DefaultExtractor, :LargestContentExtractor, :KeepEverythingExtractor, :CanolaExtractor ]
16
+ BP_OUTPUT_FORMATS = [ :html, :htmlFragment, :text, :json, :debug ]
17
17
 
18
18
  def self.extract(extract_url, opts = {})
19
- @output = opts[:output].present? ? opts[:output] : OUTPUT_FORMATS.first
20
- @extractor = opts[:extractor].present? ? opts[:extractor] : EXTRACTORS.first
21
- @api = opts[:api].present? ? opts[:api] : DEFAULT_API_URL
19
+ @output = opts[:output].present? ? opts[:output] : BP_OUTPUT_FORMATS.first
20
+ @extractor = opts[:extractor].present? ? opts[:extractor] : BP_EXTRACTORS.first
21
+ @api = opts[:api].present? ? opts[:api] : BP_DEFAULT_API_URL
22
22
 
23
23
  url = [@api, "?url=#{extract_url}", "&extractor=#{@extractor}","&output=#{@output}"].join
24
24
  open(url).read
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boilerpipe
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - "Gr\xC3\xA9gory Marcilhacy"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-13 00:00:00 +02:00
18
+ date: 2010-05-15 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21