-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
146 lines (123 loc) · 5.25 KB
/
index.php
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>jReader - A minimal jQuery and PHP based RSS reader</title>
<link rel="stylesheet" href="bootstrap-1.2.0.css">
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1.6.0");</script>
<script type="text/javascript" src="jreader.jquery.js"></script>
<script type="text/javascript">
$().ready(function(){
$('#feeds li a').jreader();
});
</script>
</head>
<body>
<div class="container-fluid">
<div class="page-header">
<h1>jReader <small>a minimal jQuery and PHP based RSS reader</small></h1>
</div>
<div class="sidebar">
<div class="clearfix">
<h2>Feeds</h2>
<ul id="feeds">
<li><a href="http://www.subooa.com.au/blog/feed">Subooa Blog</a></li>
<li><a href="http://feeds.feedburner.com/TechCrunch">Techcrunch</a></li>
<li><a href="http://minimalmac.com/rss">Minimal Mac</a></li>
<li><a href="http://rss1.smashingmagazine.com/feed/">Smashing Magazine</a></li>
<li><a href="http://feeds.feedburner.com/Noupe">Noupe Design Blog</a></li>
<li><a href="https://github.com/duellsy/jreader/commits/master.atom">jReader commit history</a></li>
</ul>
<h3>What is jReader?</h3>
<p>jReader is a simple, open source, jQuery and PHP based RSS reader for you to use in your site.</p>
<p>The main guts of the code is in the jQuery and the rss_grab.php file.</p>
<a target="_blank" href="https://github.com/duellsy/jreader" class="btn primary">Get jReader from GitHub »</a>
</div>
</div>
<div class="content">
<h2 id="jReaderTitle"></h2>
<div id="jReaderArticles" class="clearfix">
<div class="alert-message block-message warning">
<p><strong>Welcome to the jReader demo!</strong> Click on a feed in the left column to start reading the news.</p>
</div>
<h2>Developers</h2>
<p>To use jReader on your own site, you'll need to at least use these two files:</p>
<ol>
<li>rss_grab.php</li>
<li>jreader.jquery.js</li>
</ol>
<h4>Requirements</h4>
<p>This needs to be run in conjunction with jQuery, on a server that supports curl over PHP.</p>
<h4>Usage</h4>
<p>Typically, you would want to use this with a list of links to RSS feeds similar to what you see in the left column of this demo. To target the list as a jReader list, simply call the .jReader() function on the targeted elements, e.g.,</p>
<pre>$().ready(function(){
$('#feeds li a').jreader();
});</pre>
<p>You can optionally override any of the settings listed in the default settings table below, by adding them to the call e.g.,</p>
<pre>$().ready(function(){
$('#feeds li a').jreader({articleWrapClass: 'article'});
});</pre>
<h4>Default settings</h4>
<table class="zebra-striped">
<thead>
<tr>
<th>Option</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>loading</td>
<td>'Loading'</td>
<td>Text to show in the main title when the RSS is being loaded</td>
</tr>
<tr>
<td>titleElement</td>
<td>'#jReaderTitle'</td>
<td>The css selector for the element that will hold the title</td>
</tr>
<tr>
<td>fullArticle</td>
<td>'read full article'</td>
<td>Text to display as the link to read the full article</td>
</tr>
<tr>
<td>articlesElement</td>
<td>'jReaderArticles'</td>
<td>The css selector for the element that will hold the RSS items once loaded</td>
</tr>
<tr>
<td>articleWrapClass</td>
<td>'news-item'</td>
<td>Class(es) to add to the block holding each individual feed item, so you can style it as you see fit</td>
</tr>
<tr>
<td>grabberLocation</td>
<td>'./'</td>
<td>The location of the rss_grab.php file</td>
</tr>
</tbody>
</table>
</div>
<div id="footer">
<p>jReader © 2011 Chris Duell of <a href="http://subooa.com.au">Subooa Studios</a> available on <a href="http://github.com/duellsy/jreader">GitHub</a> under MIT Licence</p>
</div>
</div>
</div>
</div>
<?php
if($_SERVER['HTTP_HOST'] == 'jreader.subooa.com.au'){ ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-10845673-6']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<?php } ?>
</body>
</html>