cinch-title 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/cinch-title.gemspec +56 -0
- data/lib/cinch-title.rb +8 -4
- metadata +4 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/cinch-title.gemspec
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{cinch-title}
|
8
|
+
s.version = "0.0.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Victor Bergöö"]
|
12
|
+
s.date = %q{2010-10-27}
|
13
|
+
s.default_executable = %q{cinch-title}
|
14
|
+
s.description = %q{Plugin for the irc-framework Cinch to output HTML-titles}
|
15
|
+
s.email = %q{victor.bergoo@gmail.com}
|
16
|
+
s.executables = ["cinch-title"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".gitignore",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"bin/cinch-title",
|
28
|
+
"cinch-title.gemspec",
|
29
|
+
"lib/cinch-title.rb"
|
30
|
+
]
|
31
|
+
s.homepage = %q{http://github.com/netfeed/cinch-title}
|
32
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
+
s.require_paths = ["lib"]
|
34
|
+
s.rubygems_version = %q{1.3.7}
|
35
|
+
s.summary = %q{Plugin for Cinch to output HTML-titles}
|
36
|
+
|
37
|
+
if s.respond_to? :specification_version then
|
38
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
39
|
+
s.specification_version = 3
|
40
|
+
|
41
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
42
|
+
s.add_runtime_dependency(%q<cinch>, [">= 0"])
|
43
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
44
|
+
s.add_runtime_dependency(%q<httpclient>, [">= 0"])
|
45
|
+
else
|
46
|
+
s.add_dependency(%q<cinch>, [">= 0"])
|
47
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
48
|
+
s.add_dependency(%q<httpclient>, [">= 0"])
|
49
|
+
end
|
50
|
+
else
|
51
|
+
s.add_dependency(%q<cinch>, [">= 0"])
|
52
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
53
|
+
s.add_dependency(%q<httpclient>, [">= 0"])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
data/lib/cinch-title.rb
CHANGED
@@ -7,6 +7,7 @@ require 'cinch'
|
|
7
7
|
require 'nokogiri'
|
8
8
|
require 'httpclient'
|
9
9
|
require 'uri'
|
10
|
+
require 'cgi'
|
10
11
|
|
11
12
|
module Cinch
|
12
13
|
module Plugins
|
@@ -18,7 +19,9 @@ module Cinch
|
|
18
19
|
|
19
20
|
def execute m, message
|
20
21
|
suffix = m.user.nick[-1] == 's' ? "'" : "'s"
|
21
|
-
|
22
|
+
|
23
|
+
ignore = []
|
24
|
+
ignore = config["ignore"] if config.key? "ignore"
|
22
25
|
|
23
26
|
URI.extract(message) do |uri|
|
24
27
|
begin
|
@@ -37,10 +40,11 @@ module Cinch
|
|
37
40
|
|
38
41
|
def parse uri
|
39
42
|
client = HTTPClient.new
|
40
|
-
|
43
|
+
content = client.get(uri).content
|
44
|
+
content.force_encoding "UTF-8"
|
41
45
|
|
42
|
-
html = Nokogiri::HTML(
|
43
|
-
html.
|
46
|
+
html = Nokogiri::HTML(content, encoding="UTF-8")
|
47
|
+
CGI.unescape_html html.at("title").text.gsub(/\s+/, ' ')
|
44
48
|
end
|
45
49
|
end
|
46
50
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Victor Berg\xC3\xB6\xC3\xB6"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-10-
|
17
|
+
date: 2010-10-27 00:00:00 +02:00
|
18
18
|
default_executable: cinch-title
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- Rakefile
|
73
73
|
- VERSION
|
74
74
|
- bin/cinch-title
|
75
|
+
- cinch-title.gemspec
|
75
76
|
- lib/cinch-title.rb
|
76
77
|
has_rdoc: true
|
77
78
|
homepage: http://github.com/netfeed/cinch-title
|