Skip to content

Commit 4b25c59

Browse files
committed
Remove /news which has not been updated in 5 years
1 parent dc5fc66 commit 4b25c59

File tree

6 files changed

+0
-308
lines changed

6 files changed

+0
-308
lines changed

News.md

Lines changed: 0 additions & 179 deletions
This file was deleted.

lib/MetaCPAN/Middleware/OldUrls.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ sub _routes { (
7070
[ '/permission/module/:module', '/module/:module/permissions' ],
7171

7272
[ '/feed/recent', '/recent.:type', $feed_type ],
73-
[ '/feed/news', '/news.:type', $feed_type ],
7473
[ '/feed/author/:author', '/author/:author/activity.:type', $feed_type ],
7574
[ '/feed/distribution/:dist', '/dist/:dist/releases.:type', $feed_type ],
7675

lib/MetaCPAN/Web/Controller/Feed.pm

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use HTML::Escape qw( escape_html );
1010
use MetaCPAN::Web::RenderUtil qw( render_markdown );
1111
use MetaCPAN::Web::Types qw( ArrayRef DateTime Enum HashRef Str Undef Uri );
1212
use Params::ValidationCompiler qw( validation_for );
13-
use Path::Tiny qw( path );
1413
use XML::FeedPP (); ## no perlimports
1514
use URI ();
1615

@@ -59,60 +58,6 @@ sub recent : Private {
5958
);
6059
}
6160

62-
sub news_rss : Path('/news.rss') Args(0) {
63-
my ( $self, $c ) = @_;
64-
$c->detach( 'news', ['rss'] );
65-
}
66-
67-
sub news_atom : Path('/news.atom') Args(0) {
68-
my ( $self, $c ) = @_;
69-
$c->detach( 'news', ['atom'] );
70-
}
71-
72-
sub news : Private {
73-
my ( $self, $c, $type ) = @_;
74-
75-
$c->add_surrogate_key('NEWS');
76-
$c->browser_max_age('1h');
77-
$c->cdn_max_age('1h');
78-
79-
my $file = $c->config->{home} . '/News.md';
80-
my $news = path($file)->slurp_utf8;
81-
$news =~ s/^\s+|\s+$//g;
82-
my @entries;
83-
foreach my $str ( split /^Title:\s*/m, $news ) {
84-
next if $str =~ /^\s*$/;
85-
86-
my %e;
87-
$e{name} = $str =~ s/\A(.+)$//m ? $1 : 'No title';
88-
89-
# Use the same processing as _Header2Label in
90-
# Text::MultiMarkdown
91-
my $a_name = lc $e{name};
92-
$a_name =~ s/[^A-Za-z0-9:_.-]//g;
93-
$a_name =~ s/^[^a-z]+//gi;
94-
95-
$str =~ s/\A\s*-+//g;
96-
$e{date} = $str =~ s/^Date:\s*(.*)$//m ? $1 : '2014-01-01T00:00:00';
97-
$e{link} = '/news';
98-
$e{fragment} = $a_name;
99-
$e{author} = 'METACPAN';
100-
$str =~ s/^\s*|\s*$//g;
101-
102-
#$str =~ s{\[([^]]+)\]\(([^)]+)\)}{<a href="$2">$1</a>}g;
103-
$e{abstract} = $str;
104-
$e{abstract} = render_markdown($str);
105-
106-
push @entries, \%e;
107-
}
108-
109-
$c->stash->{feed} = $self->build_feed(
110-
format => $type,
111-
entries => \@entries,
112-
host => $c->config->{web_host},
113-
title => 'Recent MetaCPAN News',
114-
);
115-
}
11661

11762
sub author_rss : Chained('/author/root') PathPart('activity.rss') Args(0) {
11863
$_[1]->detach( 'author', ['rss'] );

lib/MetaCPAN/Web/Controller/News.pm

Lines changed: 0 additions & 24 deletions
This file was deleted.

root/news.tx

Lines changed: 0 additions & 32 deletions
This file was deleted.

t/controller/feed.t

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,23 +95,6 @@ test_psgi app, sub {
9595
);
9696
}
9797
);
98-
get_feed_ok(
99-
$cb,
100-
'/news.rss',
101-
sub {
102-
my ( $res, $tx ) = @_;
103-
test_cache_headers(
104-
$res,
105-
{
106-
cache_control => 'max-age=3600',
107-
surrogate_key =>
108-
'NEWS content_type=application/rss+xml content_type=application',
109-
surrogate_control =>
110-
'max-age=3600, stale-if-error=2592000',
111-
}
112-
);
113-
}
114-
);
11598

11699
test_redirect( $cb, 'oalders' );
117100

0 commit comments

Comments
 (0)