blogfun 0.0.1

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 (2) hide show
  1. data/lib/blogfun.rb +15 -0
  2. metadata +61 -0
@@ -0,0 +1,15 @@
1
+ require 'rubygems'
2
+ require 'hpricot'
3
+ require 'open-uri'
4
+
5
+ module Blogfun
6
+ URL = "http://www.blogfan.org/"
7
+ def self.active_user_ranking
8
+ doc = Hpricot(open(URL))
9
+ doc.search("div.hlf dl.service dd ol li").map do |li|
10
+ name, user = li.inner_html.gsub(/<.*?>(.+)<\/a>(.+)&nbsp;人$/, '\1\2').split("&nbsp;"*2)
11
+ [name, user.to_i]
12
+ end
13
+ end
14
+ end
15
+
metadata ADDED
@@ -0,0 +1,61 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blogfun
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Masaki Komagata
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-08-03 00:00:00 +09:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: hpricot
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0.5"
23
+ version:
24
+ description: Project that offers API for various data of www.blogfun.org.
25
+ email: komagata@gmail.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files: []
31
+
32
+ files:
33
+ - lib/blogfun.rb
34
+ has_rdoc: false
35
+ homepage: http://blogfun.rubyforge.org
36
+ post_install_message:
37
+ rdoc_options: []
38
+
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.8.5
46
+ version:
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ requirements: []
54
+
55
+ rubyforge_project: blogfun
56
+ rubygems_version: 1.1.1
57
+ signing_key:
58
+ specification_version: 2
59
+ summary: Project that offers API for various data of www.blogfun.org.
60
+ test_files: []
61
+