-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnews.php
More file actions
72 lines (58 loc) · 1.82 KB
/
news.php
File metadata and controls
72 lines (58 loc) · 1.82 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" encoding="utf8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de">
<head>
<title>Lab::Measurement - measurement control in Perl: News</title>
<link rel="stylesheet" type="text/css" href="doku.css" />
</head>
<body>
<?php
set_include_path("./include");
require_once('SimplePie.compiled.php');
?>
<div id="header"><img id="logo" src="header.png" alt="Lab::Measurement"/></div>
<div id="toc">
<h1>Links</h1>
<?php include 'deflinks.html'; ?>
<h2>Download Lab::Measurement</h2>
<ul>
<li><a href="https://metacpan.org/release/Lab-Measurement">CPAN releases</a></li>
<li><a href="https://github.com/lab-measurement/lab-measurement">Github</a></li>
</ul>
</div>
<style>
div.separator {
float: right;
margin-left: 30px;
margin-top: 5px;
margin-bottom: 5px;
}
</style>
<h1>News blog</h1>
<?php
// We'll process this feed with all of the default options.
$feed = new SimplePie();
// Disable cache for the start
$feed->enable_cache(false);
// Set which feed to process.
// FIXME: re-add Simon
$feed->set_feed_url('http://dilfridge.blogspot.com/feeds/posts/default/-/lab-measurement');
// Run SimplePie.
$feed->init();
// This makes sure that the content is sent to the browser as text/html and the UTF-8 character set (since we didn't change it).
$feed->handle_content_type();
$counter = 1;
foreach ($feed->get_items() as $item ) {
if ($counter<26) {
$title = $item->get_title();
$content = $item->get_content();
$url = $item->get_link();
$published = $item->get_date('j F Y');
echo "<h2><a name='pos$counter'></a>$title <font size='-1'>(posted $published)</font></h2>\n";
echo "<div class='onlytext'>$content</div><br>\n\n";
};
$counter++;
}
?>
</body>
</html>