mechanize-content 0.1.0 → 0.1.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 (5) hide show
  1. data/README.rdoc +26 -1
  2. data/Rakefile +1 -0
  3. data/VERSION +1 -1
  4. data/mechanize-content.gemspec +58 -0
  5. metadata +17 -2
data/README.rdoc CHANGED
@@ -1,6 +1,31 @@
1
1
  = mechanize-content
2
2
 
3
- pass in a url or urls and mechanize-content will select the best block of text, image and title by analysing the page content
3
+ Returns the most important pieces of content on a web page. Finds the best block of text, image and title by analysing the page content.
4
+
5
+ === Usage
6
+
7
+ Pass in a URL on initialisation and then call the helpers to pull the best content out.
8
+
9
+ <tt>mc = MechanizeContent.new("http://www.joystiq.com/2010/03/19/mag-gets-free-trooper-gear-pack-dlc-next-week/")</tt>
10
+
11
+ <tt>mc.best_title</tt>
12
+
13
+ <tt>"MAG gets free 'Trooper Gear Pack' DLC next week -- Joystiq"</tt>
14
+
15
+ <tt>mc.best_text</tt>
16
+
17
+ <tt>"Ten-hut, soldiers! HQ has just sent word that some new gear will be shipping to the front lines of MAG next week, free of charge: the Trooper Gear Pack. In this parcel, we'll finally get access to the Flashbang grenade..."</tt>
18
+
19
+ <tt>mc.best_image</tt>
20
+
21
+ <tt>"http://www.blogcdn.com/www.joystiq.com/media/2010/03/580mage302.jpg"</tt>
22
+
23
+ The gem also supports multiple URLs and will find the best content between them. The order in which they are inserted determines priority.
24
+
25
+ === Dependancies
26
+
27
+ * Mechanize
28
+ * imagesize
4
29
 
5
30
  == Note on Patches/Pull Requests
6
31
 
data/Rakefile CHANGED
@@ -11,6 +11,7 @@ begin
11
11
  gem.homepage = "http://github.com/john-griffin/mechanize-content"
12
12
  gem.authors = ["John Griffin"]
13
13
  gem.add_dependency('mechanize', '>= 1.0.0')
14
+ gem.add_dependency('imagesize', '>= 0.1.1')
14
15
  end
15
16
  Jeweler::GemcutterTasks.new
16
17
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -0,0 +1,58 @@
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{mechanize-content}
8
+ s.version = "0.1.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["John Griffin"]
12
+ s.date = %q{2010-03-19}
13
+ s.description = %q{pass in a url or urls and mechanize-content will select the best block of text, image and title by analysing the page content}
14
+ s.email = %q{johnog@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/mechanize-content.rb",
27
+ "mechanize-content.gemspec",
28
+ "spec/mechanize-content_spec.rb",
29
+ "spec/spec.opts",
30
+ "spec/spec_helper.rb"
31
+ ]
32
+ s.homepage = %q{http://github.com/john-griffin/mechanize-content}
33
+ s.rdoc_options = ["--charset=UTF-8"]
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.3.6}
36
+ s.summary = %q{scrape the best content from a page}
37
+ s.test_files = [
38
+ "spec/mechanize-content_spec.rb",
39
+ "spec/spec_helper.rb"
40
+ ]
41
+
42
+ if s.respond_to? :specification_version then
43
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<mechanize>, [">= 1.0.0"])
48
+ s.add_runtime_dependency(%q<imagesize>, [">= 0.1.1"])
49
+ else
50
+ s.add_dependency(%q<mechanize>, [">= 1.0.0"])
51
+ s.add_dependency(%q<imagesize>, [">= 0.1.1"])
52
+ end
53
+ else
54
+ s.add_dependency(%q<mechanize>, [">= 1.0.0"])
55
+ s.add_dependency(%q<imagesize>, [">= 0.1.1"])
56
+ end
57
+ end
58
+
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Griffin
@@ -31,6 +31,20 @@ dependencies:
31
31
  version: 1.0.0
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: imagesize
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ - 1
44
+ - 1
45
+ version: 0.1.1
46
+ type: :runtime
47
+ version_requirements: *id002
34
48
  description: pass in a url or urls and mechanize-content will select the best block of text, image and title by analysing the page content
35
49
  email: johnog@gmail.com
36
50
  executables: []
@@ -48,6 +62,7 @@ files:
48
62
  - Rakefile
49
63
  - VERSION
50
64
  - lib/mechanize-content.rb
65
+ - mechanize-content.gemspec
51
66
  - spec/mechanize-content_spec.rb
52
67
  - spec/spec.opts
53
68
  - spec/spec_helper.rb