This repository has been archived by the owner on Sep 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathremove-or-recrawl-urls.html
153 lines (145 loc) · 6.55 KB
/
remove-or-recrawl-urls.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This code is not supported by Google
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simple form for removing URLs using a feed</title>
<script type="text/javascript">
function buildFeed(header, records, footer, attributes ) {
var records_xml = '';
var rl = records.length;
attributes = typeof attributes !== 'undefined' ? attributes : '';
for (r = 0; r < rl; r++) {
if (records[r].length != 0) {
records_xml += ' <record url="' + records[r] + '" mimetype="text/plain" ' + attributes + ' />\n';
}
}
return header + records_xml + footer;
}
function actionURLs(groupAction, recordAttributes) {
var feed_type = document.getElementById('feed_type');
var feed_datasource = document.getElementById('feed_datasource');
var feed_textarea = document.getElementById('feed_textarea');
var urls_textarea = document.getElementById('urls_textarea');
var action = '';
if (groupAction == 'delete') {
feed_datasource.value = 'remove-urls';
action = 'action="delete"';
} else {
feed_datasource.value = 'web';
}
if (recordAttributes == 'crawl-immediately') {
recordAttributes = 'crawl-immediately="true"';
} else {
recordAttributes = '';
}
feed_type.value = 'incremental';
header = '<?xml version="1.0" encoding="iso-8859-1"?>\n' +
'<!DOCTYPE gsafeed PUBLIC "-//Google//DTD GSA Feeds//EN" "">\n' +
'<gsafeed>\n' +
' <header>\n' +
' <datasource>' + feed_datasource.value + '</datasource>\n' +
' <feedtype>' + feed_type.value + '</feedtype>\n' +
' </header>\n' +
' <group ' + action + ' >\n';
footer = ' </group>\n</gsafeed>';
feed_textarea.value = buildFeed(header,
urls_textarea.value.split('\n'),
footer,
recordAttributes);
submitForm();
}
function submitForm() {
var feed_form = document.getElementById('feed_form');
var appliance = document.getElementById('appliance_input').value;
var protocol = document.getElementById('protocol').value;
if (protocol == 'https') {
var port = "19902";
} else {
var port = "19900";
}
feed_form.action = protocol + "://" + appliance + ":" + port + "/xmlfeed"
feed_form.submit();
}
</script>
</head>
<body>
<div style="margin: 0 auto; width: 720px;">
<h2>Remove or recrawl URLs by sending an XML feed</h2>
<p>This forms generates an XML feed for the Google Search Appliance,
which will tell the appliance to remove or recrawl the provided URLs.</p>
<ol>
<li>Enter the <b>Appliance hostname or IP address</b>, and select HTTP or HTTPS (port 19900 or 19902).
Notes: HTTPS for feed is added since 6.10.4.G.22</li>
<li>Enter URLs into the <b>URLs to remove/recrawl</b> text box, one URL per line, no comments are allowed.</li>
<li>Press the appropriate button:
<ul>
<li><b>Remove them</b> will submit an incremental content feed (datasource <tt>remove-urls</tt>) with
one record per URL, all in a group with <tt>action="delete"</tt> to remove them from the index.</li>
<li><b>Recrawl them</b> will submit a web feed (datasource <tt>web</tt>) with
one record per URL, with no meta data to inject them in the crawl queue.</li>
<li><b>Recrawl them immediately</b> will submit a web feed (datasource <tt>web</tt>) with
one record per URL, with no meta data to inject them in the crawl queue and with additional flag to crawl immediately.</li>
</ul>
</li>
</ol>
<p>Read the <a href="http://www.google.com/support/enterprise/static/gsa/docs/admin/74/gsa_doc_set/feedsguide/feedsguide.html"
>Feeds Protocol Developer's Guide</a> to learn more about how this works.</p>
<form name="urls" id="urls_form" action="#">
<p>Appliance hostname or IP address:
<input type="text" name="appliance" id="appliance_input" />
<select id="protocol">
<option>http</option>
<option>https</option>
</select>
</p>
<p>
URLs to remove/recrawl:
</p>
<textarea name="urls" cols="100" rows="25" id="urls_textarea"></textarea>
<p>
<input type="button" value="Remove them" onclick="actionURLs('delete');" />
<input type="button" value="Re-crawl them!" onclick="actionURLs('add');" />
<input type="button" value="Re-crawl them immediately!" onclick="actionURLs('add','crawl-immediately');" />
</p>
</form>
<form enctype="multipart/form-data" method="post"
name="feed" id="feed_form"
action="http://127.0.0.1:19900/xmlfeed">
<p>Generated Feed XML Codes:</p>
<input type="hidden" name="datasource" id="feed_datasource" />
<input type="hidden" name="feedtype" id="feed_type" />
<textarea name="data" cols="100" rows="1" id="feed_textarea"></textarea>
</form>
<p>Copyright © 2015 Google Inc. All Rights Reserved.</p>
<p>Latest version can be found <a
href="https://github.com/google/gsa-admin-toolkit/blob/master/remove-or-recrawl-urls.html"
>on GitHub</a>.
<p>Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at <a
href="http://www.apache.org/licenses/LICENSE-2.0"
>http://www.apache.org/licenses/LICENSE-2.0</a>.
<p>Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</p>
<p>This script is not supported by Google.</p>
</div>
</body>
</html>