seo_site_check 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 37c0b7a623751d4a4f6a536a42eb92ef0c2ee174
4
+ data.tar.gz: c1d9dd1b2200c28858efae4081a6e2329467cf30
5
+ SHA512:
6
+ metadata.gz: 8501485f6a53388ddb994f8dc6dea2ea99adb1e8a5f1b74dd09f3c1a7e4d6e8ae3d463cdfd681fbc3bcfcf9e626cbe9cd3ee81b6120f8d00b88ccf92a9d797d1
7
+ data.tar.gz: 09d96eb1120adb77d22cfcfb6c166e3ee4457cd8b061c307aa8b1bc7f3e35c8c3e93c6dc5f0a81303a690149b973b7b1e9328a250ab96d208ca04aa2c776a8af
data/.gitignore ADDED
@@ -0,0 +1,32 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.csv
11
+ *.gem
12
+ *.rbc
13
+ /.config
14
+ /coverage/
15
+ /InstalledFiles
16
+ /pkg/
17
+ /spec/reports/
18
+ /spec/examples.txt
19
+ /test/tmp/
20
+ /test/version_tmp/
21
+ /tmp/
22
+
23
+ ## Documentation cache and generated files:
24
+ /.yardoc/
25
+ /_yardoc/
26
+ /doc/
27
+ /rdoc/
28
+
29
+ ## Environment normalization:
30
+ /.bundle/
31
+ /vendor/bundle
32
+ /lib/bundler/man/
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.0
4
+ before_install: gem install bundler -v 1.10.6
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in seo_site_check.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Ijonas Kisselbach
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Ijonas Kisselbach
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # seo_site_check
2
+
3
+ A command-line utilty that provides a report to help webmasters improve website SEO.
4
+
5
+ The report produced in CSV-format is a breakdown of all the webpages encountered on a site together with their title and H1->H6 tags.
6
+ Very simple, but I find I'm always tuning this information on my sites. Hope it helps you too.
7
+
8
+ ![Image of SEO Site Report](https://raw.githubusercontent.com/ijonas/seo_site_check/master/assets/seo_site_check_screenshot.jpg)
9
+
10
+ ## Installation
11
+
12
+ SEO Site Check is meant to be run as a command line utility. To install on OSX and Unix-based systems:
13
+
14
+ $ gem install seo_site_check
15
+
16
+ ## Usage
17
+
18
+ Running SEO Site check only requires the URL of the homepage of the site you're checking:
19
+
20
+ $ seo_site_check http://www.ijonas.com
21
+
22
+ which will produce an seo-site-check-report.csv file in your current folder.
23
+
24
+ You can override the file path and name by specifying an additional parameter:
25
+
26
+ $ seo_site_check http://www.ijonas.com /tmp/sitereport.csv
27
+
28
+ ## Contributing
29
+
30
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ijonas/seo_site_check. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
31
+
32
+
33
+ ## License
34
+
35
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ task :default => :test
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "seo_site_check"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,63 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "seo_site_check"
5
+ require "cobweb"
6
+ require "csv"
7
+
8
+
9
+ homepage = ARGV.first
10
+ output_file = ARGV.length > 1 ? ARGV[1] : "seo-site-check-report.csv"
11
+
12
+ crawler = CobwebCrawler.new(
13
+ debug: false,
14
+ valid_mime_types: ['text/*']
15
+ )
16
+
17
+ url_headings = {}
18
+ hdrs = %w(h1 h2 h3 h4 h5 h6)
19
+ htag_counts = {}
20
+ hdrs.each {|h| htag_counts[h] = 0}
21
+
22
+ def cleanup_hdr(hdr)
23
+ val = hdr.strip.gsub("\n", " ")
24
+ val = "EMPTY" if val.empty?
25
+ val
26
+ end
27
+
28
+ crawler.crawl(homepage) do |page|
29
+ if page[:mime_type]=="text/html"
30
+ puts page[:url]
31
+
32
+ doc = Nokogiri::HTML(page[:body])
33
+ headers = {
34
+ title: cleanup_hdr(doc.xpath("//title").first.content)
35
+ }
36
+ hdrs.each do |htag|
37
+ tags = doc.xpath("//#{htag}").map(&:content).map{|c|cleanup_hdr c}
38
+ tags = ["EMPTY"] if tags.empty?
39
+ headers[htag] = tags
40
+ htag_counts[htag] = tags.length if tags.length > htag_counts[htag]
41
+ end
42
+ url_headings[page[:url]] = headers
43
+ end
44
+ end
45
+ CSV.open(output_file, "wb") do |csv|
46
+ hdr_row = ["url", "title"]
47
+ hdrs.each do |hdr|
48
+ no_occs = htag_counts[hdr]
49
+ hdr_row.concat( [].fill(hdr,0..no_occs-1) )
50
+ end
51
+ csv << hdr_row
52
+ url_headings.each do |url, headers|
53
+ row = [ url, headers[:title] ]
54
+ hdrs.each do |hdr|
55
+ no_hdr_occs = htag_counts[hdr]
56
+ prepped_row = [].fill("",0..no_hdr_occs-1)
57
+ headers[hdr].each_with_index {|hv, i| prepped_row[i] = hv }
58
+ row.concat(prepped_row)
59
+ end
60
+ csv << row
61
+ end
62
+ end
63
+ puts "Finished. See #{output_file}"
@@ -0,0 +1,5 @@
1
+ require "seo_site_check/version"
2
+
3
+ module SeoSiteCheck
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,3 @@
1
+ module SeoSiteCheck
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'seo_site_check/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "seo_site_check"
8
+ spec.version = SeoSiteCheck::VERSION
9
+ spec.authors = ["Ijonas Kisselbach"]
10
+ spec.email = ["ijonas@ijonas.com"]
11
+
12
+ spec.summary = %q{Provides a report to help webmasters improve website SEO.}
13
+ spec.description = %q{Provides a report to help webmasters improve website SEO. Makes it easy for webmasters to see a breakdown of URLs and all the title and H1-H6 tags on their site.}
14
+ spec.homepage = "https://github.com/ijonas/seo_site_check"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.10"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "minitest", '~> 5.8'
25
+
26
+ spec.add_dependency 'cobweb', '~> 1.1'
27
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: seo_site_check
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ijonas Kisselbach
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-02-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.8'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: cobweb
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.1'
69
+ description: Provides a report to help webmasters improve website SEO. Makes it easy
70
+ for webmasters to see a breakdown of URLs and all the title and H1-H6 tags on their
71
+ site.
72
+ email:
73
+ - ijonas@ijonas.com
74
+ executables:
75
+ - seo_site_check
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - ".travis.yml"
81
+ - CODE_OF_CONDUCT.md
82
+ - Gemfile
83
+ - LICENSE
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - assets/seo_site_check_screenshot.jpg
88
+ - bin/console
89
+ - bin/setup
90
+ - exe/seo_site_check
91
+ - lib/seo_site_check.rb
92
+ - lib/seo_site_check/version.rb
93
+ - seo_site_check.gemspec
94
+ homepage: https://github.com/ijonas/seo_site_check
95
+ licenses:
96
+ - MIT
97
+ metadata: {}
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.4.8
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: Provides a report to help webmasters improve website SEO.
118
+ test_files: []