forked from larsmagne/gwene
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnew-gwene
More file actions
executable file
·40 lines (34 loc) · 851 Bytes
/
new-gwene
File metadata and controls
executable file
·40 lines (34 loc) · 851 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
37
38
39
#!/usr/bin/perl
# Go through the queue of new feeds and see if any of them are new.
# If so, start feeding the group.
while (1) {
undef %created;
if (-f "/home/tmp/gwene-created") {
open(CREATED, "/home/tmp/gwene-created");
while (<CREATED>) {
chop;
$created{$_} = 1;
}
close CREATED;
unlink "/home/tmp/gwene-created";
sleep(2);
open(GROUPS, "/var/lib/news/newsgroups") || die;
while (<GROUPS>) {
chop;
($group, $desc) = split(/\t/);
$groups{$group} = 1;
}
close GROUPS;
open(GWENE, "/home/tmp/gwene-requests") || die;
while (<GWENE>) {
chop;
($group, $url, $urlid, $date, $parent_id) = split(/\t/);
if ($groups{$group} && $created{$group}) {
print "Feeding $group $url\n";
system("/home/larsi/gwene/fetch-rss", $url, $group,
$parent_id);
}
}
}
sleep(1);
}