-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTODO2RSS.cgi
More file actions
executable file
·36 lines (25 loc) · 811 Bytes
/
TODO2RSS.cgi
File metadata and controls
executable file
·36 lines (25 loc) · 811 Bytes
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
#!/usr/bin/perl -w
# RSS generator for Code TODO comments
use strict;
use XML::RSS;
use CGI qw(:standard);
use File::Find;
# y'all be wanting to change the next line
my $start_directory = "/Users/ben/Code/";
my $rss = new XML::RSS(version => '0.91');
$rss -> channel(title => "Code TODOs");
find (\&search_and_rss, $start_directory);
sub search_and_rss {
open (CODEFILE, "< $File::Find::name");
while (<CODEFILE>) {
if ($_ =~ m/TODO/) {
$rss -> add_item(title => "$File::Find::name",
link => "file:\/\/$File::Find::name",
description => "$_ at Line $. of $File::Find::name");
#TODO: Put in date code here
}
}
close (CODEFILE);
}
print header('application/xml+rss');
print $rss->as_string;