Full-Text RSS

Full-Text RSS Git Source Tree

Root/index.php

1<?php
2require_once(dirname(__FILE__).'/config.php');
3// check for custom index.php (custom_index.php)
4if (!defined('_FF_FTR_INDEX')) {
5    define('_FF_FTR_INDEX', true);
6    if (file_exists(dirname(__FILE__).'/custom_index.php')) {
7        include(dirname(__FILE__).'/custom_index.php');
8        exit;
9    }
10}
11?>
12<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
13    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
14<html xmlns="http://www.w3.org/1999/xhtml">
15  <head>
16    <title>Full-Text RSS Feeds | from fivefilters.org</title>
17    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
18    <meta name="robots" content="noindex, follow" />
19    <script type="text/javascript" src="niceforms.js"></script>
20    <link rel="stylesheet" href="css/niceforms-default.css" type="text/css" media="screen" />
21    <script type="text/javascript" src="js/niceforms.js"></script>
22    <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>-->
23    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
24    <script type="text/javascript">
25    var baseUrl = 'http://'+window.location.host+window.location.pathname.replace(/(\/index\.php|\/)$/, '');
26    $(document).ready(function() {
27        $('#form').submit(function() {
28            $('#url').val($('#url').val().replace(/^http:\/\//i, ''));
29            return true;
30        });
31    });
32    </script>
33  </head>
34  <body style="background-color: #eee; margin: 0; line-height: 1.4em;">
35    <div id="container">
36    <h1 style="padding-bottom: 30px;">Full-Text RSS <?php echo _FF_FTR_VERSION; ?> <span style="font-size: .7em; font-weight: normal;">&mdash; from <a href="http://fivefilters.org">FiveFilters.org</a></span></h1>
37    <form method="get" action="makefulltextfeed.php" id="form" class="niceform">
38    <fieldset>
39        <legend>Create full-text feed from feed or webpage URL</legend>
40        <dl>
41            <dt><label for="url">Enter URL:</label></dt>
42            <dd><input type="text" id="url" name="url" style="width: 450px;" /></dd>
43        </dl>
44    </fieldset>
45    <fieldset>
46    <legend>Options</legend>
47    <?php if ($options->extraction_pattern == 'user') { ?>
48    <dl>
49        <dt><label for="what">Extraction pattern:</label></dt>
50        <dd><input type="text" id="what" name="what" value="auto" style="width: 250px;" /></dd>
51    </dl>
52    <?php } ?>
53    <?php if (isset($options->api_keys) && !empty($options->api_keys)) { ?>
54    <dl>
55        <dt><label for="key">API key:</label></dt>
56        <dd><input type="text" id="key" name="key" style="width: 250px;" /></dd>
57    </dl>
58    <?php } ?>
59    <dl>
60        <dt><label for="max">Max items:</label></dt>
61        <dd><select name="max" id="max">
62            <?php for ($i = 1; $i <= $options->max_entries; $i++) {
63                printf("<option value=\"%s\"%s>%s</option>\n", $i, ($i==$options->default_entries) ? ' selected="selected"' : '', $i);
64                }
65            ?>
66            </select>
67        </dd>
68    </dl>
69    <dl>
70        <dt><label for="links">Links:</label></dt>
71        <dd><select name="links">
72            <option value="preserve" selected="selected">preserve</option>
73            <option value="footnotes">add to footnotes</option>
74            <option value="remove">remove</option>
75            </select></label></dd>
76    </dl>
77    <?php if ($options->exclude_items_on_fail == 'user') { ?>
78    <dl>
79        <dt><label for="exc">If extraction fails:</label></dt>
80        <dd><select name="exc">
81            <option value="" selected="selected">keep item in feed</option>
82            <option value="1">remove item from feed</option>
83            </select></label></dd>
84    </dl>
85    <?php } ?>
86    </fieldset>
87    <fieldset class="action" style="background: transparent; border: none; margin-bottom: 20px; padding: 0;">
88        <input type="submit" id="sudbmit" name="submit" value="Create Feed" />
89    </fieldset>
90    </form>
91    
92    <hr />
93    
94    <h2>For the site owner</h2>
95    
96    <p>Thanks for downloading and setting this up. If you haven't done so already, <a href="ftr_compatibility_test.php">check server compatibility</a>
97    to see if your environment will support this application. Full-Text RSS runs on most shared web hosting environments.</p>
98    <h3>Configure</h3>
99    <p>In addition to the options above, Full-Text RSS can be configured to better suit your needs. Features include:</p>
100    <ul>
101        <li>Site patterns for better control over extraction (<a href="site_config/README.txt">more info</a>)</li>
102        <li>Restrict access to a pre-defined set of URLs or block certain URLs</li>
103        <li>Restrict the maximum number of feed items to be processed</li>
104        <li>JSON output</li>
105        <li>Prepend or append an HTML fragment to each feed item processed</li>
106        <li>Caching</li>
107    </ul>
108    <p>Please refer to the <a href="http://fivefilters.org/content-only/guide/user_guide_2.8.pdf">user guide</a> for more information.</p>
109    <p><?php if (!file_exists('custom_config.php')) { ?>To change the configuration, save a copy of <tt>config.php</tt> as <tt>custom_config.php</tt> and make any changes you like to it.<?php } else { ?>To change the configuration, edit <tt>custom_config.php</tt> and make any changes you like.<?php } ?></p>
110
111    <p>If everything works fine, feel free to modify this page by saving it as <tt>custom_index.php</tt> and change it to whatever you like.</p>
112    
113    <h3>Sharing is caring</h3>
114    If you plan to offer this service to others through your hosted copy, please keep a download link so users can grab a copy of the code if they
115    want it (you can either offer the download yourself, or link to the download page on fivefilters.org to support us).
116    That's one requirement of the <a href="http://www.gnu.org/licenses/agpl-3.0.html" title="AGPLv3">license</a>.</p>
117    <p>Thanks! :)</p>
118
119    <h3 id="donate">Updates</h3>
120    <p>To see if you're running the latest version, <a href="http://fivefilters.org/content-only/latest_version.php?version=<?php echo urlencode(_FF_FTR_VERSION); ?>">check for updates</a>.</p>
121    
122    <h3 id="donate">Support</h3>
123    <p>We have a <a href="https://member.fivefilters.org/f/">public forum</a> which anyone can use to discuss any issues, post questions and find answers (it's free to join and post).</p>
124    <p>We provide a little more information in the section below, but if you need help with anything, you can also email us at <a href="mailto:fivefilters@fivefilters.org">fivefilters@fivefilters.org</a>.</p>
125    
126    <hr />
127    
128    <h2>For everyone</h2>
129    
130    <h3>About</h3>
131    <p>This is a free software project to help people extract content from web pages. It can extract content from a standard HTML page and return a 1-item feed or it can transform an existing feed into a full-text feed. It is being developed as part of the <a href="http://fivefilters.org">Five Filters</a> project to promote independent, non-corporate media.</p>
132    
133    <h3>Bookmarklet</h3>
134    <p>To easily transform partial-feeds you encounter (or convert any content on a page into a 1-item feed), drag the link below to your browser's bookmarks toolbar.
135    Then whenever you'd like a full-text feed, click the bookmarklet.</p>
136    <p>Drag this:
137    <script type="text/javascript">
138    document.write('<a style="cursor: move;" onclick="alert(\'drag to bookmarks toolbar\'); return false;" href="javascript:location.href=\''+baseUrl+'/makefulltextfeed.php?url=\'+encodeURIComponent(document.location.href);">Full-Text RSS</a>');
139    </script>
140    
141    <h3 id="api">API</h3>
142    <p>To extract content from a web page or to transform an existing partial feed to full text, pass the URL (<a href="http://meyerweb.com/eric/tools/dencoder/">encoded</a>) in the querystring to the following URL:</p>
143    <ul>
144        <li style="font-family: monospace;"><script type="text/javascript">document.write(baseUrl);</script>/makefulltextfeed.php?url=<strong>[url]</strong></li>
145    </ul>
146    
147    <p>All the parameters in the form above can be passed in this way. Examine the URL in the addressbar after you click 'Create Feed' to see the values.</p>
148    
149    <p>Note: If you're not hosting this yourself, you do not have to rely on an external API if you don't want to &mdash; this is a free software (open source)
150    project licensed under the AGPL. You're free to <a href="http://fivefilters.org/content-only/#download">download your own copy</a>.</p>
151    
152    <h3>Source Code and Technologies</h3>
153    <p><p>The application uses <a href="http://en.wikipedia.org/wiki/PHP">PHP</a>, <a href="http://www.keyvan.net/2010/08/php-readability/">PHP Readability</a>, <a href="http://simplepie.org/">SimplePie</a>, <a href="http://www.ajaxray.com/blog/2008/03/08/php-universal-feed-generator-supports-rss-10-rss-20-and-atom/">FeedWriter</a>, Humble HTTP Agent. Depending on your configuration, these optional components may also be used: <a href="http://framework.zend.com/manual/en/zend.cache.introduction.html">Zend Cache</a>, <a href="http://framework.zend.com/manual/en/zend.dom.query.html">Zend DOM Query</a>, <a href="http://code.google.com/p/rolling-curl/">Rolling Curl</a> and <a href="http://hg.gsnedders.com/iri/">IRI</a>. Readability is the magic piece of code that tries to identify and extract the content block from any given web page.</p>
154
155    <h3>System Requirements</h3>
156    
157    <p>PHP 5.2 or above is required. A simple shared web hosting account will work fine.
158    The code has been tested on Windows and Linux using the Apache web server. If you're a Windows user, you can try it on your own machine using <a href="http://www.wampserver.com/en/index.php">WampServer</a>. It has also been reported as working under IIS, but we have not tested this ourselves.</p>
159    
160    <h3 id="download">Download</h3>
161    <p>Download from <a href="http://fivefilters.org/content-only/#download">fivefilters.org</a> - old versions are available in the code repository.</p>
162    
163    <h3>License</h3>
164    <p><a href="http://en.wikipedia.org/wiki/Affero_General_Public_License" style="border-bottom: none;"><img src="images/agplv3.png" alt="AGPL logo" /></a><br />This web application is licensed under the <a href="http://en.wikipedia.org/wiki/Affero_General_Public_License">AGPL version 3</a> &mdash; which basically means if you use the code to offer the same or similar service for your users, you are also required to share the code with your users so they can examine the code and run it for themselves. (<a href="http://www.clipperz.com/users/marco/blog/2008/05/30/freedom_and_privacy_cloud_call_action">More on why this is important.</a>)</p>
165    <p>The libraries used by the application are licensed as follows...</p>
166    <ul>
167        <li>PHP Readability: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License v2</a></li>
168        <li>SimplePie: <a href="http://en.wikipedia.org/wiki/BSD_license">BSD</a></li>
169        <li>FeedWriter: <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GPL v2</a></li>
170        <li>Humble HTTP Agent: <a href="http://en.wikipedia.org/wiki/Affero_General_Public_License">AGPL v3</a></li>
171        <li>Zend: <a href="http://framework.zend.com/license/new-bsd">New BSD</a></li>
172        <li>IRI: <a href="http://en.wikipedia.org/wiki/BSD_license">BSD</a></li>
173        <li>Rolling Curl: <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License v2</a></li>
174    </ul>
175    
176    </div>
177  </body>
178</html>

Archive Download this file

Branches