App-jupiter
view release on metacpan or search on metacpan
Changes
lib/App/jupiter.pm
LICENSE
Makefile.PL
MANIFEST This list of files
README.md
script/jupiter
share/default.css
share/feed.png
share/feed.rss
share/jupiter.png
share/jupiter.svg
share/personalize.js
share/template.html
t/atom.t
t/author.t
t/basic-operation.t
t/duplicate-links.t
t/duplicates.t
t/elements.t
t/empty.t
There are a number of files in the `share` directory which you can use as
starting points.
`template.html` is the HTML template.
`default.css` is a small CSS file used by `template.html`.
`personalize.js` is a small Javascript file used by `template.html` used to
allow visitors to jump from one article to the next using `J` and `K`.
`jupiter.png` is used by `template.html` as the icon.
`jupiter.svg` is used by `template.html` as the logo.
`feed.png` is used by `template.html` as the icon for the feeds in the
sidebar.
`feed.rss` is the feed template.
# OPTIONS
HTML generation uses a template, `template.html`. It is written for
`Mojo::Template` and you can find it in the `share` directory of your
distribution. The default templates use other files, such as the logo, the feed
icon, a CSS file, and a small Javascript snippet to enable navigation using the
script/jupiter view on Meta::CPAN
There are a number of files in the F<share> directory which you can use as
starting points.
F<template.html> is the HTML template.
F<default.css> is a small CSS file used by F<template.html>.
F<personalize.js> is a small Javascript file used by F<template.html> used to
allow visitors to jump from one article to the next using C<J> and C<K>.
F<jupiter.png> is used by F<template.html> as the icon.
F<jupiter.svg> is used by F<template.html> as the logo.
F<feed.png> is used by F<template.html> as the icon for the feeds in the
sidebar.
F<feed.rss> is the feed template.
=head1 OPTIONS
HTML generation uses a template, C<template.html>. It is written for
C<Mojo::Template> and you can find it in the F<share> directory of your
distribution. The default templates use other files, such as the logo, the feed
icon, a CSS file, and a small Javascript snippet to enable navigation using the
share/jupiter.svg view on Meta::CPAN
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="svg64"
width="357.33334"
height="356"
viewBox="0 0 357.33334 356"
sodipodi:docname="jupiter.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
inkscape:export-filename="/home/alex/Pictures/jupiter.png"
inkscape:export-xdpi="35.36512"
inkscape:export-ydpi="35.36512">
<metadata
id="metadata70">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
share/template.html view on Meta::CPAN
% my ($globals, $feeds, $entries) = @_;
<!DOCTYPE html>
<html>
<head profile="http://www.w3.org/2005/10/profile">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="jupiter.png" type="image/png"/>
<link rel="icon" href="jupiter.png" type="image/png"/>
<link rel="stylesheet" href="default.css" type="text/css"/>
<title>Planet</title>
<meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Jupiter">
<link rel="alternate" href="https://example.org/atom.xml" title="Planet" type="application/atom+xml">
<script type="text/javascript" src="personalize.js"> </script></head>
<body>
<p class="invisible">
share/template.html view on Meta::CPAN
<div id="sidebar">
<p class="logo">
<img src="jupiter.svg">
<p class="small">
<a href="/wiki/Planet/What_is_this%3f">What is this?</a> â¢
<a href="/wiki/Planet/Please_join!">Please join!</a>
<h2><label for="toggle">Members</label></h2>
<input type="checkbox" id="toggle">
<ul id="toggled">
% for my $feed (@$feeds) {
<li><a href="<%= $feed->{url} =%>"><img src="feed.png" alt="(feed)"></a> \
% if ($feed->{message} and $feed->{code} and $feed->{code} ne "200" and $feed->{code} ne "304" and $feed->{link}) {
<a class="message" title="<%= $feed->{message} =%>" href="<%= $feed->{link} =%>"><%= $feed->{title} =%></a>
% } elsif ($feed->{link}) {
<a href="<%= $feed->{link} =%>"><%= $feed->{title} =%></a>
% } elsif ($feed->{message} and (not $feed->{code} or $feed->{code} ne "200")) {
<a class="message" title="<%= $feed->{message} =%>"><%= $feed->{title} =%></a>
% } else {
%= $feed->{title}
% }
% }
t/basic-operation.t view on Meta::CPAN
is($messages->{"http://127.0.0.1:$port/"}->{message}, "OK", "HTTP status message is 'OK'");
is($messages->{"http://127.0.0.1:$port/"}->{title}, "Feed", "Title was taken from the OPML file");
Jupiter::make_html("test-$id/rss2sample.html", "test-$id/rss2sample.xml", "test-$id/rss2sample.opml");
ok(-f "test-$id/rss2sample.html", "HTML was generated");
my $html = read_binary "test-$id/rss2sample.html";
unlike($html, qr/syntax error at template/, "No syntax errors in the HTML");
my $doc = XML::LibXML->load_html(string => $html);
ok($doc->findnodes('//a[@href="http://127.0.0.1:' . $port . '/"]'
. '/img[@src="feed.png"][@alt="(feed)"]'), "Sidebar feed link OK");
ok($doc->findnodes('//a[@class="message"][@title="No feed updates in 90 days"]'
. '[@href="http://liftoff.msfc.nasa.gov/"][text()="Liftoff News"]'),
"Sidebar site link OK");
my $feed = XML::LibXML->load_xml(string => $rss);
my @items = $feed->findnodes('//item');
for my $item (@items) {
my $title = $item->findvalue('title');
my $found = $doc->findnodes('//h3/a[text()="' . ($title||"Untitled") . '"]');
ok($found, "Found in the HTML: " . ($title||"Untitled"));
( run in 0.824 second using v1.01-cache-2.11-cpan-788537b7465 )