-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathezrssfeedgen.pl
More file actions
40 lines (40 loc) · 1004 Bytes
/
ezrssfeedgen.pl
File metadata and controls
40 lines (40 loc) · 1004 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
40
#!/usr/bin/perl
#
# This scripts expects a csv file in the format Show Name;Quality
# and merges all the resulting RSS feeds from ezrss.it
#
# Example:
# Burn Notice;720p
# IT Crowd;PDTV
#
# Should be called like this:
# /usr/bin/perl ezrssfeedgen.pl tvshows.csv > tvshows.xml
#
use strict;
use warnings;
use XML::FeedPP;
my $feed = XML::FeedPP::RSS->new();
my $search_url = 'http://ezrss.it/search/index.php?simple&show_name=NAME&date=&quality=QUALITY&release_group=&mode=rss';
while(<>){
chomp;
(my $name, my $quality, my $extra) = split(/;/,$_);
$name =~ s/[\#\!\*\$]/ /g;
$name =~ s/(^\s+|\s+$)//g;
#$name =~ s/\s+$//g;
$name =~ s/\s+/+/g;
my $url = $search_url;
$url =~ s/NAME/$name/;
$url =~ s/QUALITY/$quality/;
if ($extra) {
$url .= $extra;
}
#print $url ,"\n";
$feed->merge($url);
}
my $hostname = `hostname -f`;
chomp($hostname);
$feed->title("$hostname TV Shows");
$feed->limit_item(25);
my $now = time();
$feed->pubDate( $now );
print $feed->to_string();