pageinfo 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/README.md +2 -4
- data/lib/pageinfo/version.rb +1 -1
- data/lib/pageinfo.rb +0 -10
- data/pageinfo.gemspec +0 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e56106d24a0e8bd5b4e1528a79bb194f6d4ccd1
|
4
|
+
data.tar.gz: 56f5811f7f928d79bc15a8414447d1a0fd81581b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd43507764143701b101e236644800faa3113e5932f3a7beccaa443542a69bbaba96a9a346a62d6a65078db9d565f64c060fb27ff6cbc0c5c9c3918501cc3ab6
|
7
|
+
data.tar.gz: 77720c46e5746be7f9ebceb8b668315125fb8e1579faa415b8cc193c2b100538ffc9d6c05cacbb5b34e92978b20470f57c8e74965f2668ce37c695fd6c870bb7
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Pageinfo
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/meta-tags.svg)](http://badge.fury.io/rb/meta-tags)
|
4
|
+
|
3
5
|
Pageinfo will browse through your site then list every page on your site and give detail meta info about the page.
|
4
6
|
|
5
7
|
## Installation
|
@@ -26,10 +28,6 @@ Browse your site using:
|
|
26
28
|
|
27
29
|
## Development
|
28
30
|
|
29
|
-
<!-- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). -->
|
32
|
-
|
33
31
|
## Contributing
|
34
32
|
|
35
33
|
1. Fork it ( https://github.com/aditiamahdar/pageinfo/fork )
|
data/lib/pageinfo/version.rb
CHANGED
data/lib/pageinfo.rb
CHANGED
@@ -4,12 +4,6 @@ require "typhoeus"
|
|
4
4
|
require "nokogiri"
|
5
5
|
|
6
6
|
module Pageinfo
|
7
|
-
def self.hi
|
8
|
-
greeting = "Hello World!"
|
9
|
-
puts greeting
|
10
|
-
greeting
|
11
|
-
end
|
12
|
-
|
13
7
|
def self.detect(url)
|
14
8
|
content = ["url", "status", "time", "title", "description", "keyword"].join(",")
|
15
9
|
content << new_line
|
@@ -25,14 +19,11 @@ module Pageinfo
|
|
25
19
|
content << new_line
|
26
20
|
|
27
21
|
@links = get_page_links(page)
|
28
|
-
# puts "Homepage links: #{@links.count}"
|
29
22
|
while true do
|
30
|
-
# puts "Links: #{@links.count} left"
|
31
23
|
if link = @links.shift
|
32
24
|
full_url = get_full_url(link)
|
33
25
|
unless full_url.nil?
|
34
26
|
if (scrapped_urls & [full_url, "#{full_url}/", "#{full_url}/#"]).empty?
|
35
|
-
# No duplicate link
|
36
27
|
conn = Typhoeus.get(full_url)
|
37
28
|
page = Nokogiri::HTML(conn.body)
|
38
29
|
content << get_info(conn, page)
|
@@ -45,7 +36,6 @@ module Pageinfo
|
|
45
36
|
new_links = new_links - @links
|
46
37
|
new_links = new_links - scrapped_links
|
47
38
|
@links = @links + new_links unless new_links.empty?
|
48
|
-
# puts "Links: #{@links.count} left, #{new_links.count} new links"
|
49
39
|
end
|
50
40
|
end
|
51
41
|
else
|
data/pageinfo.gemspec
CHANGED
@@ -19,10 +19,6 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
# if spec.respond_to?(:metadata)
|
23
|
-
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
24
|
-
# end
|
25
|
-
|
26
22
|
spec.add_dependency "typhoeus", "~> 0.7"
|
27
23
|
spec.add_dependency "nokogiri", "~> 1.6"
|
28
24
|
|