-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprsslistcgi.pl
executable file
·143 lines (106 loc) · 3.34 KB
/
prsslistcgi.pl
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
#!/usr/bin/perl
#
# Original software (c) Copyright 2004, 2005 Software Garden, Inc. All Rights Reserved.
# pRSSlist Copyright (c) 2009, lantrix, TechDebug.com
# Subject to Software License at the end of this file
#
#
# prsslist RSS Generator Program
#
# This is the interface for using the program
# through a normal web server.
#
# Put this file in a cgi-bin directory or equivalent
# and use a browser to access the UI.
#
use strict;
use pRSSlist;
use CGI::Carp qw(fatalsToBrowser);
# Output header
print <<"EOF";
Content-type: text/html; charset=UTF-8
Expires: Thu, 01 Jan 1970 00:00:00 GMT
EOF
# Get query parameters
my $query;
if ($ENV{REQUEST_METHOD} eq 'POST') {
read(STDIN, $query, $ENV{CONTENT_LENGTH});
}
else {
$query = $ENV{QUERY_STRING};
}
# Process the request and output the results
my $content = process_request($query, 1);
if ($content) {
print $content;
}
else {
print <<"EOF";
<html>
<head>
<title>Quitting</title>
<body>
Quitting.<br><br><b>You may close the browser window.</b>
<br><br>
<a href="$ENV{SCRIPT_NAME}">Restart</a>
</body>
</html>
EOF
}
__END__
=head1 NAME
prsslistcgi.pl
=head1 VERSION
This is prsslistcgi.pl v2.0.
=head1 AUTHOR
Originally authored by Dan Bricklin, Software Garden, Inc.
pRSSlist author lantrix, Techdebug.com
=head1 COPYRIGHT
Original Software (c) Copyright 2004, 2005 Software Garden, Inc. All Rights Reserved.
pRSSlist Copyright (c) 2009, lantrix, TechDebug.com
See Software License in the program file.
=cut
#
# HISTORY
#
# Version 2.0 17 Nov 2009
# Created inital version of pRSSlist from ListGarden
#
#
# TODO:
#
#
=begin license
SOFTWARE LICENSE
Original software (c) Copyright 2004, 2005 Software Garden, Inc. All Rights Reserved.
pRSSlist Copyright (c) 2009, lantrix, TechDebug.com
1. The source code of this program is made available as free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License, version 2, as published by the Free Software
Foundation.
2. This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. You should have received a
copy of the GNU General Public License along with this program; if not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite
330, Boston, MA 02111-1307, USA.
3. An appropriate copyright notice will include the original Software Garden,
Inc. copyright plus the pRSSlist copyright, and a prominent change notice will include a
reference to Software Garden, Inc., as the originator of the code
to which the changes were made.
Disclaimer
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Original Software Creator:
Software Garden, Inc.
PO Box 610369
Newton Highlands, MA 02461 USA
www.softwaregarden.com
=end
=cut