-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblog.html
More file actions
65 lines (61 loc) · 2.31 KB
/
blog.html
File metadata and controls
65 lines (61 loc) · 2.31 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
<?php
$page = 'Blog';
require_once('header.php');
?>
<div id='main'>
<div class='wrapper'>
<div class="blogItems">
<h1>
Blog
</h1>
<p id="pleaseWait">
Our blog comes from the drumbeat.org Thimbl project page!
<br /><br />
Please click here if it doesn't load: <a href="http://drumbeat.org/project/thimbl-decentralized-micro-blogging-platform/">http://drumbeat.org/project/thimbl-decentralized-micro-blogging-platform/</a>.
</p>
</div>
<div style="clear: both;"></div>
</div>
</div>
<?php require_once('footer.php'); ?>
<script type="text/javascript">
// Read in the blog
moo = function getBlogXmlAndDump()
{
// Check we're on the right page...
// Is there a better way of doing this?
var url = 'http://query.yahooapis.com/v1/public/yql?q='+
'select%20*%20from%20rss%20where%20url%3D%22h'+
'ttps%3A%2F%2Fwww.drumbeat.org%2Fnode%2F10987'+
'4%2Fblog%2Ffeed%22&format=json';
$.ajax({
async: false, // We need to wait and see if it works...
type: "GET",
url: url,
dataType: "jsonp",
error: function(data) {
moo();
},
success: function(str) {
// for each blog post
$(str.query.results.item).each(function(key, value){
var author = value.author;
var title = value.title;
var url = value.link;
var desc = value.description;
var date = value.pubDate;
$('<div class="items"></div>')
.html(
'<h2><a href="'+url+'">'+title+'</a></h2>'+
'<span class="date">'+ date +'</span><p>'+desc+'</p>'
)
.appendTo('.blogItems');
$('#pleaseWait, .og_rss_groups').hide();
});
}
});
// run it
}();
</script>
</body>
</html>