apollo-crawler 0.0.43 → 0.0.44

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.
@@ -0,0 +1,30 @@
1
+ require 'iconv'
2
+
3
+ require File.join(File.dirname(__FILE__), '..', '..', 'plugin')
4
+
5
+ module Apollo
6
+ module Crawler
7
+ module Plugins
8
+ class StackOverflow < Plugin
9
+ @@MATCHER_ITEM = "//div[@class = 'summary']/h3/a"
10
+
11
+ def name
12
+ return "StackOverflow"
13
+ end
14
+
15
+ def url()
16
+ return "http://stackoverflow.com/"
17
+ end
18
+
19
+ def extract_data(doc)
20
+ res = doc.xpath(@@MATCHER_ITEM).map { |i|
21
+ {
22
+ :text => i.text,
23
+ :link => URI.join(self.url, i['href'])
24
+ }
25
+ }
26
+ end
27
+ end
28
+ end # Plugins
29
+ end # Crawler
30
+ end # Apollo
@@ -1,5 +1,5 @@
1
1
  module Apollo
2
2
  module Crawler
3
- VERSION = '0.0.43'
3
+ VERSION = '0.0.44'
4
4
  end # Crawler
5
5
  end # Apollo
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apollo-crawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.43
4
+ version: 0.0.44
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -233,6 +233,7 @@ files:
233
233
  - ./lib/apollo_crawler/crawler.rb
234
234
  - ./lib/apollo_crawler/formatter.rb
235
235
  - ./lib/apollo_crawler/plugin_template.rb
236
+ - ./lib/apollo_crawler/plugins/stackoverflow_com/stackoverflow.rb
236
237
  - ./lib/apollo_crawler/plugins/xkcd_com/xkcd.rb
237
238
  - ./lib/apollo_crawler/plugins/slashdot_org/slashdot.rb
238
239
  - ./lib/apollo_crawler/plugins/firmy_cz/firmy.rb