pingr 0.0.3 → 0.2.3
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.
- checksums.yaml +7 -0
- data/.gitignore +2 -1
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/.yardopts +7 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +17 -18
- data/README.md +14 -18
- data/Rakefile +11 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/docs/Pingr/PingrError.html +134 -0
- data/docs/Pingr/Request.html +232 -0
- data/docs/Pingr/SearchEngines/Base.html +668 -0
- data/docs/Pingr/SearchEngines/Bing.html +294 -0
- data/docs/Pingr/SearchEngines/Google.html +294 -0
- data/docs/Pingr/SearchEngines.html +117 -0
- data/docs/Pingr.html +593 -0
- data/docs/_config.yml +1 -0
- data/docs/_index.html +181 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +496 -0
- data/docs/file.README.html +146 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +146 -0
- data/docs/index.md +37 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +179 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/pingr/request.rb +10 -64
- data/lib/pingr/search_engines/base.rb +62 -0
- data/lib/pingr/search_engines/bing.rb +22 -0
- data/lib/pingr/search_engines/google.rb +21 -0
- data/lib/pingr/version.rb +3 -1
- data/lib/pingr.rb +27 -19
- data/lib/tasks/pingr.rake +19 -0
- data/pingr.gemspec +17 -13
- data/spec/pingr_spec.rb +7 -0
- data/spec/spec_helper.rb +16 -0
- metadata +83 -28
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1da583e92b4854f6711ef65023bfa6063d8438e87ed5ab3010153f610fa97213
|
4
|
+
data.tar.gz: ab8fb62ec2b20063c6b06229103301bb9247abf6134760d9e424248df0c30648
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c6125d0330a643114584c6f6a78b5e36c681f6111d157e8d84452c1d9ee016533c97d1d1c0db5dbd40cc8ca88114617ada2cf23cb519ed4d6d5c66a211595712
|
7
|
+
data.tar.gz: 441d0e64fb314ae818db406a537df8c5e922a2a451dd65539720f0883231f390dd51a3d3e16a04a40dd55e6d27071ffc69c4aca249fd9434eda45fa6e3f9c0e3
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/.yardopts
ADDED
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2020 Bodacious
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the following conditions:
|
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:
|
12
11
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
15
14
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF
|
22
|
-
|
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
CHANGED
@@ -22,7 +22,7 @@ From within your app (most likely a controller):
|
|
22
22
|
|
23
23
|
``` ruby
|
24
24
|
def ping_sitemaps
|
25
|
-
Pingr::Request.new(
|
25
|
+
Pingr::Request.new(my_sitemap_url) # This will ping Google and Bing
|
26
26
|
end
|
27
27
|
```
|
28
28
|
|
@@ -32,30 +32,21 @@ A good way to do this would be using Rails's after filters:
|
|
32
32
|
class PostsController < ActionController::Base
|
33
33
|
|
34
34
|
after_filter :ping_sitemaps, only: [:create, :update, :destroy]
|
35
|
-
|
36
|
-
# ...
|
37
|
-
|
35
|
+
|
36
|
+
# ...
|
37
|
+
|
38
38
|
private
|
39
|
-
|
39
|
+
|
40
40
|
def ping_sitemaps
|
41
|
-
Pingr::Request.new(
|
42
|
-
Pingr::Request.new(:bing, my_sitemap_url).ping
|
41
|
+
Pingr::Request.new(my_sitemap_url)
|
43
42
|
end
|
44
|
-
|
45
|
-
end
|
46
|
-
```
|
47
|
-
|
48
|
-
You can ping all [supported search engines](https://github.com/KatanaCode/pingr/blob/master/lib/pingr.rb#L9) by doing:
|
49
43
|
|
50
|
-
``` ruby
|
51
|
-
def ping_sitemaps
|
52
|
-
for search_engine in Pingr::SUPPORTED_SEARCH_ENGINES
|
53
|
-
Pingr::Request.new(search_engine, my_sitemap_url).ping
|
54
|
-
end
|
55
44
|
end
|
56
45
|
```
|
57
46
|
|
58
|
-
|
47
|
+
You can view the [supported search engines](https://github.com/KatanaCode/pingr/tree/master/lib/pingr/search_engines) and add your own by viewing the code in this directory:
|
48
|
+
|
49
|
+
https://github.com/KatanaCode/pingr/tree/master/lib/pingr/search_engines
|
59
50
|
|
60
51
|
## Modes
|
61
52
|
|
@@ -77,3 +68,8 @@ Pingr.mode = :live if Rails.env =~ /staging|production/
|
|
77
68
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
78
69
|
4. Push to the branch (`git push origin my-new-feature`)
|
79
70
|
5. Create new Pull Request
|
71
|
+
|
72
|
+
|
73
|
+
## About Katana
|
74
|
+
|
75
|
+
Katana are [web and mobile app developers in Edinburgh, Scotland](http://katanacode.com/ "Katana Code").
|
data/Rakefile
CHANGED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'pingr'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Exception: Pingr::PingrError
|
8
|
+
|
9
|
+
— Pingr
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Pingr::PingrError";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (P)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Pingr.html" title="Pingr (module)">Pingr</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">PingrError</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Exception: Pingr::PingrError
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">StandardError</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">StandardError</li>
|
78
|
+
|
79
|
+
<li class="next">Pingr::PingrError</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/pingr.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
<p>Exceptions raised from within Pingr are of this class</p>
|
107
|
+
|
108
|
+
|
109
|
+
</div>
|
110
|
+
</div>
|
111
|
+
<div class="tags">
|
112
|
+
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</div>
|
125
|
+
|
126
|
+
<div id="footer">
|
127
|
+
Generated on Thu Aug 13 16:28:50 2020 by
|
128
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
|
+
0.9.24 (ruby-2.6.6).
|
130
|
+
</div>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
</body>
|
134
|
+
</html>
|
@@ -0,0 +1,232 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Pingr::Request
|
8
|
+
|
9
|
+
— Pingr
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Pingr::Request";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (R)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../Pingr.html" title="Pingr (module)">Pingr</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Request</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Pingr::Request
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Pingr::Request</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/pingr/request.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
<p>The object created to ping a search engine with a sitemap</p>
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
<div class="tags">
|
110
|
+
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<h2>
|
121
|
+
Instance Method Summary
|
122
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
123
|
+
</h2>
|
124
|
+
|
125
|
+
<ul class="summary">
|
126
|
+
|
127
|
+
<li class="public ">
|
128
|
+
<span class="summary_signature">
|
129
|
+
|
130
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(sitemap_url) ⇒ Object </a>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</span>
|
135
|
+
|
136
|
+
|
137
|
+
<span class="note title constructor">constructor</span>
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
<span class="summary_desc"><div class='inline'><p>Initialize a new ping request.</p>
|
147
|
+
</div></span>
|
148
|
+
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
152
|
+
</ul>
|
153
|
+
|
154
|
+
|
155
|
+
<div id="constructor_details" class="method_details_list">
|
156
|
+
<h2>Constructor Details</h2>
|
157
|
+
|
158
|
+
<div class="method_details first">
|
159
|
+
<h3 class="signature first" id="initialize-instance_method">
|
160
|
+
|
161
|
+
#<strong>initialize</strong>(sitemap_url) ⇒ <tt>Object</tt>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</h3><div class="docstring">
|
168
|
+
<div class="discussion">
|
169
|
+
<p>Initialize a new ping request</p>
|
170
|
+
|
171
|
+
|
172
|
+
</div>
|
173
|
+
</div>
|
174
|
+
<div class="tags">
|
175
|
+
<p class="tag_title">Parameters:</p>
|
176
|
+
<ul class="param">
|
177
|
+
|
178
|
+
<li>
|
179
|
+
|
180
|
+
<span class='name'>sitemap_url</span>
|
181
|
+
|
182
|
+
|
183
|
+
<span class='type'></span>
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
—
|
188
|
+
<div class='inline'><p>A String url of the sitemap we're submitting</p>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
</li>
|
192
|
+
|
193
|
+
</ul>
|
194
|
+
|
195
|
+
|
196
|
+
</div><table class="source_code">
|
197
|
+
<tr>
|
198
|
+
<td>
|
199
|
+
<pre class="lines">
|
200
|
+
|
201
|
+
|
202
|
+
14
|
203
|
+
15
|
204
|
+
16
|
205
|
+
17</pre>
|
206
|
+
</td>
|
207
|
+
<td>
|
208
|
+
<pre class="code"><span class="info file"># File 'lib/pingr/request.rb', line 14</span>
|
209
|
+
|
210
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_sitemap_url'>sitemap_url</span><span class='rparen'>)</span>
|
211
|
+
<span class='const'><span class='object_link'><a href="../Pingr.html" title="Pingr (module)">Pingr</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SearchEngines.html" title="Pingr::SearchEngines (module)">SearchEngines</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SearchEngines/Bing.html" title="Pingr::SearchEngines::Bing (class)">Bing</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="SearchEngines/Base.html#initialize-instance_method" title="Pingr::SearchEngines::Base#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_sitemap_url'>sitemap_url</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ping'>ping</span>
|
212
|
+
<span class='const'><span class='object_link'><a href="../Pingr.html" title="Pingr (module)">Pingr</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SearchEngines.html" title="Pingr::SearchEngines (module)">SearchEngines</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SearchEngines/Google.html" title="Pingr::SearchEngines::Google (class)">Google</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="SearchEngines/Base.html#initialize-instance_method" title="Pingr::SearchEngines::Base#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_sitemap_url'>sitemap_url</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_ping'>ping</span>
|
213
|
+
<span class='kw'>end</span></pre>
|
214
|
+
</td>
|
215
|
+
</tr>
|
216
|
+
</table>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div id="footer">
|
225
|
+
Generated on Thu Aug 13 16:28:50 2020 by
|
226
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
227
|
+
0.9.24 (ruby-2.6.6).
|
228
|
+
</div>
|
229
|
+
|
230
|
+
</div>
|
231
|
+
</body>
|
232
|
+
</html>
|