diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9ccb0b1..58bc713 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,3 +26,5 @@ Note : If you have large portions of text, use [Github's Gist service](https://g ## You want to fix a bug or to add a feature Please fork wallabag and work with **the dev branch** only. **Do not work on master branch**. + +[Don't forget to read our guidelines](https://github.com/wallabag/wallabag/blob/dev/GUIDELINES.md). \ No newline at end of file diff --git a/COPYING.md b/COPYING.md index ee7d6a5..c43f619 100644 --- a/COPYING.md +++ b/COPYING.md @@ -1,14 +1,19 @@ - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 +Copyright (c) 2013-2014 Nicolas Lœuillet - Copyright (C) 2004 Sam Hocevar +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/CREDITS.md b/CREDITS.md index ffef5b3..e76c580 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,7 +1,6 @@ wallabag is based on : * PHP Readability https://bitbucket.org/fivefilters/php-readability * Full Text RSS http://code.fivefilters.org/full-text-rss/src -* Encoding https://github.com/neitanod/forceutf8 * logo by Maylis Agniel https://github.com/wallabag/logo * icons http://icomoon.io * PHP Simple HTML DOM Parser (for Pocket import) http://simplehtmldom.sourceforge.net/ @@ -11,6 +10,8 @@ wallabag is based on : * Pagination https://github.com/daveismyname/pagination * PHPePub https://github.com/Grandt/PHPePub/ -wallabag is developed by Nicolas Lœuillet under the Do What the Fuck You Want to Public License +wallabag is mainly developed by Nicolas Lœuillet under the MIT License + +Thank you so much to @tcitworld and @mariroz. Contributors : https://github.com/wallabag/wallabag/graphs/contributors diff --git a/GUIDELINES.md b/GUIDELINES.md new file mode 100644 index 0000000..51e0de9 --- /dev/null +++ b/GUIDELINES.md @@ -0,0 +1,53 @@ +# Guidelines for wallabag + +If you want to contribute to wallabag, you have some rules to respect. These rules were defined by [PHP Framework Interop Group](http://www.php-fig.org). + +## Basic Coding Standard (PSR-1) + +This section of the standard comprises what should be considered the standard coding elements that are required to ensure a high level of technical interoperability between shared PHP code. + +* Files MUST use only ` +Copyright © 2013-2014 Nicolas Lœuillet This work is free. You can redistribute it and/or modify it under the -terms of the Do What The Fuck You Want To Public License, Version 2, -as published by Sam Hocevar. See the COPYING file for more details. +terms of the MIT License. See the COPYING file for more details. diff --git a/TRANSLATION.md b/TRANSLATION.md index 2e38d5c..a033662 100755 --- a/TRANSLATION.md +++ b/TRANSLATION.md @@ -1,10 +1,10 @@ -# How to manage translations of wallabag +# How to manage translations for wallabag -This guide will describe procedure of translation management of wallabag web application. +This guide will describe the procedure of translation management of the wallabag web application. -All translation are made using [gettext](http://en.wikipedia.org/wiki/Gettext) system and tools. +All translations are made using [gettext](http://en.wikipedia.org/wiki/Gettext) system and tools. -You will need [Poedit](http://www.poedit.net/download.php) editor to update, edit and create your translation files comfortably. In general, you can handle translations also without it: all can be done using gettext tools and your favorite plain text editor only. This guide, however, describes editing with Poedit. If you want to use gettext only, pls refer to xgettext manual page to update po files from sources (see also how it is used by Poedit below) and use msgunfmt tool to compile .mo files manually. +You will need the [Poedit](http://www.poedit.net/download.php) editor to update, edit and create your translation files easily. However, you can also handle translations also without it: all can be done using gettext tools and your favorite plain text editor only. This guide, however, describes editing with Poedit. If you want to use gettext only, please refer to the xgettext manual page to update po files from sources (see also how it is used by Poedit below) and use msgunfmt tool to compile .mo files manually. You need to know, that translation phrases are stored in **".po"** files (for example: `locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po`), which are then complied in **".mo"** files using **msgfmt** gettext tool or by Poedit, which will run msgfmt for you in background. @@ -22,7 +22,7 @@ go to root of your installation of wallabag project and run next command: `rm -rf ./cache/*` -(this may require root privileges if you run, for example Apatche web server with mod_php) +(this may require root privileges if you run, for example Apache web server with mod_php) ### 2. Generate php files from all twig templates Do this using next command: @@ -31,37 +31,37 @@ Do this using next command: OR -from your browser: **http://your-wallabag-host.com/locale/tools/fillCache.php** (this may require removal of .htacces file in locale/ directory). +from your browser: **http://your-wallabag-host.com/locale/tools/fillCache.php** (this may require removal of .htaccess file in locale/ directory). ### 3. Configure your Poedit Open Poedit editor, open Edit->Preferences. Go to "Parsers" tab, click on PHP and press "Edit" button. Make sure your "Parser command:" looks like `xgettext --no-location --force-po -o %o %C %K %F` -Usualy it is required to add "--no-location" to default value. +Usually it is required to add "--no-location" to default value. -### 4. Open .po file you want to edit in Poedit and change it's settings +### 4. Open .po file you want to edit in Poedit and change its settings Open, for example `locale/pl_PL.utf8/LC_MESSAGES/pl_PL.utf8.po` file in your Poedit. -Go to "Catalog"->"Settings..." menu. Go to "Path" tab and add path to wallabag installaion in your local file system. This step can't be ommited as you will not be able to update phrases otherwise. +Go to "Catalog"->"Settings..." menu. Then go to "Path" tab and add path to wallabag installation in your local file system. This step can't be omitted as you will not be able to update phrases otherwise. You can also check "project into" tab to be sure, that "Language" is set correctly (this will allow you to spell check your translation). ### 5. Update opened .po file from sources Once you have set your path correctly, you are able to update phrases from sources. Press "Update catalog - synchronize it with sources" button or go to "Catalog"->"Update from sources" menu. -As a result you will see confirmation popup with two tabs: "New strings" and "Obsolete strings". Pls review and accept changes (or press "Undo" if you see too many obsolete strings, as Poedit will remove them all - in this case please make sure all previous steps are performed w/o errors). +As a result you will see confirmation popup with two tabs: "New strings" and "Obsolete strings". Please review and accept changes (or press "Undo" if you see too many obsolete strings, as Poedit will remove them all - in this case please make sure all previous steps are performed w/o errors). ### 6. Translate and save your .po file -If you have any dificulties on this step, please consult with Poedit manual. -Every time you save your .po file, Poedit will also comple appropriate .mo file by default (of course, if not disabled in preferences). +If you have any difficulties on this step, please consult with Poedit manual. +Every time you save your .po file, Poedit will also compile appropriate .mo file by default (of course, if not disabled in preferences). -So, you are almost done. +You are now almost done. ### 7. Clear cache again This step may be required if your web server runs php scripts in name of, say, www user (i.e. Apache with mod_php, not cgi). -##To create new translation -Please simple create appropriate directories in locale folder and perform all steps, described above. Instead of opening an existing file just create new one. +##To create new translation +You just have to copy the folder corresponding to the language you want to translate from, change language in the project settings and for the folder and files names. Then start replacing all existing translations with your own. diff --git a/check_essentials.php b/check_essentials.php new file mode 100644 index 0000000..a47cd5a --- /dev/null +++ b/check_essentials.php @@ -0,0 +1,14 @@ + "short_open_tag = On"'); + } +} \ No newline at end of file diff --git a/check_setup.php b/check_setup.php old mode 100644 new mode 100755 index 2b84a74..cf02c34 --- a/check_setup.php +++ b/check_setup.php @@ -1,28 +1,10 @@ "short_open_tag = On"'); - } -} - // Check if /cache is writeable if (! is_writable('cache')) { die('The directory "cache" must be writeable by your web server user'); } -// Check if /db is writeable -if (! is_writable('db')) { - die('The directory "db" must be writeable by your web server user'); -} - // install folder still present, need to install wallabag if (is_dir('install')) { require('install/index.php'); diff --git a/inc/3rdparty/FlattrItem.class.php b/inc/3rdparty/FlattrItem.class.php index 711b4ee..ef8c62f 100644 --- a/inc/3rdparty/FlattrItem.class.php +++ b/inc/3rdparty/FlattrItem.class.php @@ -1,28 +1,35 @@ + * @copyright 2013 + * @license http://opensource.org/licenses/MIT see COPYING file + */ +class FlattrItem +{ public $status; - public $urltoflattr; + public $urlToFlattr; public $flattrItemURL; - public $numflattrs; + public $numFlattrs; - public function checkItem($urltoflattr,$id) { - $this->cacheflattrfile($urltoflattr, $id); + public function checkItem($urlToFlattr, $id) + { + $this->_cacheFlattrFile($urlToFlattr, $id); $flattrResponse = file_get_contents(CACHE . "/flattr/".$id.".cache"); if($flattrResponse != FALSE) { $result = json_decode($flattrResponse); - if (isset($result->message)){ + if (isset($result->message)) { if ($result->message == "flattrable") { $this->status = FLATTRABLE; } } - elseif (is_object($result) && $result->link) { + elseif (is_object($result) && $result->link) { $this->status = FLATTRED; $this->flattrItemURL = $result->link; - $this->numflattrs = $result->flattrs; + $this->numFlattrs = $result->flattrs; } else { $this->status = NOT_FLATTRABLE; @@ -33,17 +40,18 @@ class FlattrItem { } } - private function cacheflattrfile($urltoflattr, $id) { + private function _cacheFlattrFile($urlToFlattr, $id) + { if (!is_dir(CACHE . '/flattr')) { mkdir(CACHE . '/flattr', 0777); } // if a cache flattr file for this url already exists and it's been less than one day than it have been updated, see in /cache if ((!file_exists(CACHE . "/flattr/".$id.".cache")) || (time() - filemtime(CACHE . "/flattr/".$id.".cache") > 86400)) { - $askForFlattr = Tools::getFile(FLATTR_API . $urltoflattr); + $askForFlattr = Tools::getFile(FLATTR_API . $urlToFlattr); $flattrCacheFile = fopen(CACHE . "/flattr/".$id.".cache", 'w+'); fwrite($flattrCacheFile, $askForFlattr); fclose($flattrCacheFile); } } -} \ No newline at end of file +} diff --git a/inc/3rdparty/Session.class.php b/inc/3rdparty/Session.class.php index 59dfbe6..b56e4c5 100644 --- a/inc/3rdparty/Session.class.php +++ b/inc/3rdparty/Session.class.php @@ -309,4 +309,38 @@ class Session return true; // User is not banned. } + + + /** + * Tells if a param exists in session + * + * @param $name name of the param to test + * @return bool + */ + public static function isInSession($name) + { + return (isset($_SESSION[$name]) ? : FALSE); + } + + /** + * Returns param in session + * + * @param $name name of the param to return + * @return mixed param or null + */ + public static function getParam($name) + { + return (self::isInSession($name) ? $_SESSION[$name] : NULL); + } + + /** + * Store value in session + * + * @param $name name of the variable to store + * @param $value value to store + */ + public static function setParam($name, $value) + { + $_SESSION[$name] = $value; + } } diff --git a/inc/3rdparty/site_config/custom/blogs.faz.net.txt b/inc/3rdparty/site_config/custom/blogs.faz.net.txt new file mode 100644 index 0000000..4f2626f --- /dev/null +++ b/inc/3rdparty/site_config/custom/blogs.faz.net.txt @@ -0,0 +1,45 @@ +# Author: zinnober + +tidy: no +prune: no + +# Set author +author: //a[@rel='author'] + +# Set date +date: //span[@class='Datum'] + +# Content is here +body: //div[@class='Artikel'] + +# Tidy up before article +strip: //div[@id='FAZHeaderNeu'] +strip: //h2[@itemprop='headline'] +strip: //span[@class='Datum'] +strip: //span[@class='Autor'] +strip_id_or_class: ArticlePagerTop +strip: //div[@class='FAZArtikelEinleitung']/h2 + +# General cleanup +strip: //div[@class='clear'] +strip: //span[@class='Bildnachweis'] +strip: //iframe +strip_id_or_class: Community +strip: ' · ' + +# Remove tracking and ads +strip_image_src: /l.gif? +strip: //img[@width='1'] +strip_id_or_class: invisible +strip_id_or_class: Anzeige +strip_id_or_class: billboard + +# Remove clutter after article +strip_id_or_class: Tagline +strip_id_or_class: ArtikelAbbinder +strip_id_or_class: FAZArtikelKommentare +strip_id_or_class: ArtikelKommentieren +strip_id_or_class: FAZContentRight + +# Try it yourself +test_url: http://blogs.faz.net/wost/2014/08/17/viel-fuck-und-wenig-guter-sex-1239/ diff --git a/inc/3rdparty/site_config/standard/24ways.org.txt b/inc/3rdparty/site_config/standard/24ways.org.txt old mode 100644 new mode 100755 index 03bd195..86c9e07 --- a/inc/3rdparty/site_config/standard/24ways.org.txt +++ b/inc/3rdparty/site_config/standard/24ways.org.txt @@ -1,6 +1,6 @@ -title: //div[@class='meta']/h2/a -author: //div[@class='meta']/h2/following-sibling::p/a/text() -date://div[@class='meta']/h2/strong -body: //div[@id='article'] +title: //div[@class='meta']/h2/a +author: //div[@class='meta']/h2/following-sibling::p/a/text() +date://div[@class='meta']/h2/strong +body: //div[@id='article'] strip: //div[@class='domore'] test_url: http://24ways.org/2011/composing-the-new-canon \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/36kr.com.txt b/inc/3rdparty/site_config/standard/36kr.com.txt new file mode 100755 index 0000000..d73d7de --- /dev/null +++ b/inc/3rdparty/site_config/standard/36kr.com.txt @@ -0,0 +1,8 @@ +title: //h1[contains(@class, 'entry-title')] +date: //meta[@name='weibo: article:create_at']/@content +body: //div[contains(@class, 'mainContent')] +strip_id_or_class: related_topics + +prune: no + +test_url: http://www.36kr.com/p/207879.html \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/37signals.com.txt b/inc/3rdparty/site_config/standard/37signals.com.txt old mode 100644 new mode 100755 index 43a10ae..531cac1 --- a/inc/3rdparty/site_config/standard/37signals.com.txt +++ b/inc/3rdparty/site_config/standard/37signals.com.txt @@ -1,6 +1,6 @@ -title: //div[@class='post_header']//h2/a -author: //span[@class='author'] -date: //span[@class='date'] -body: //div[@id='Content'] +title: //div[@class='post_header']//h2/a +author: //span[@class='author'] +date: //span[@class='date'] +body: //div[@id='Content'] test_url: http://37signals.com/svn/posts/2785-the-end-of-the-it-department \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/3quarksdaily.com.txt b/inc/3rdparty/site_config/standard/3quarksdaily.com.txt old mode 100644 new mode 100755 index c4e7940..80a3958 --- a/inc/3rdparty/site_config/standard/3quarksdaily.com.txt +++ b/inc/3rdparty/site_config/standard/3quarksdaily.com.txt @@ -1,9 +1,9 @@ -body: //div[@class='content'] -date: //div[@class='content']/h2 -strip: //div[@class='content']/h2 -title: //div[@class='content']/h3 - -strip: //div[@id='postmenu'] -strip: //div[@class='trackback'] -tidy: no +body: //div[@class='content'] +date: //div[@class='content']/h2 +strip: //div[@class='content']/h2 +title: //div[@class='content']/h3 + +strip: //div[@id='postmenu'] +strip: //div[@class='trackback'] +tidy: no test_url: http://www.3quarksdaily.com/3quarksdaily/2012/01/martin-luther-king-i-have-a-dream.html \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/3voor12.vpro.nl.txt b/inc/3rdparty/site_config/standard/3voor12.vpro.nl.txt old mode 100644 new mode 100755 diff --git a/inc/3rdparty/site_config/standard/43folders.com.txt b/inc/3rdparty/site_config/standard/43folders.com.txt old mode 100644 new mode 100755 index e8073f6..3777c66 --- a/inc/3rdparty/site_config/standard/43folders.com.txt +++ b/inc/3rdparty/site_config/standard/43folders.com.txt @@ -1,4 +1,4 @@ -body: //*[@class = 'content'] -author: //*[@class = 'submitted']/a +body: //*[@class = 'content'] +author: //*[@class = 'submitted']/a date: substring-after(//*[@class = 'submitted']/text(), '|') test_url: http://www.43folders.com/2011/04/22/cranking \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/500px.com.txt b/inc/3rdparty/site_config/standard/500px.com.txt old mode 100644 new mode 100755 index 68e6b2d..b9b7e9d --- a/inc/3rdparty/site_config/standard/500px.com.txt +++ b/inc/3rdparty/site_config/standard/500px.com.txt @@ -1,27 +1,27 @@ -# very loose setup for both 500px.com/photo/* and 500px.com/blog/* -# photo page example: http://500px.com/photo/4181666 -# blog page example: http://500px.com/blog/110 - -# avoid "no text" error -tidy:no -prune:no - -# reorganize photo page elements -#body://div[contains(@class,'container')] -move_into(body)://div[contains(@id,'thephoto')] -move_into(body)://div[contains(@id,'description')] -move_into(body)://div[contains(@id,'tags')] -move_into(body)://div[contains(@id,'photo-info')] - -# clean photo page info -strip://span[contains(@id,'copyright')] -strip://*[contains(@id,'store')] -strip://*[contains(@id,'user-info')] -strip://*[contains(@id,'photo-stats')] -strip://*[contains(@id,'voting_controls_container')] -strip://*[contains(@id,'more-photos')] -strip://*[contains(@id,'embed-photo')] - -# clean blog page side bar +# very loose setup for both 500px.com/photo/* and 500px.com/blog/* +# photo page example: http://500px.com/photo/4181666 +# blog page example: http://500px.com/blog/110 + +# avoid "no text" error +tidy:no +prune:no + +# reorganize photo page elements +#body://div[contains(@class,'container')] +move_into(body)://div[contains(@id,'thephoto')] +move_into(body)://div[contains(@id,'description')] +move_into(body)://div[contains(@id,'tags')] +move_into(body)://div[contains(@id,'photo-info')] + +# clean photo page info +strip://span[contains(@id,'copyright')] +strip://*[contains(@id,'store')] +strip://*[contains(@id,'user-info')] +strip://*[contains(@id,'photo-stats')] +strip://*[contains(@id,'voting_controls_container')] +strip://*[contains(@id,'more-photos')] +strip://*[contains(@id,'embed-photo')] + +# clean blog page side bar strip://*[contains(@class,'col d3 clearafter')] test_url: http://500px.com/photo/3641041?from=editors \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/512pixels.net.txt b/inc/3rdparty/site_config/standard/512pixels.net.txt old mode 100644 new mode 100755 diff --git a/inc/3rdparty/site_config/standard/5by5.tv.txt b/inc/3rdparty/site_config/standard/5by5.tv.txt old mode 100644 new mode 100755 index dce0df4..59b70a9 --- a/inc/3rdparty/site_config/standard/5by5.tv.txt +++ b/inc/3rdparty/site_config/standard/5by5.tv.txt @@ -1,9 +1,9 @@ -body: //*[@id="episode"] -prune: no -tidy: no - -autodetect_next_page: no -strip_id_or_class: player - +body: //*[@id="episode"] +prune: no +tidy: no + +autodetect_next_page: no +strip_id_or_class: player + strip://*[@id="header"] test_url: http://5by5.tv/buildanalyze/60 \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/7newsbelize.com.txt b/inc/3rdparty/site_config/standard/7newsbelize.com.txt new file mode 100755 index 0000000..46d09f8 --- /dev/null +++ b/inc/3rdparty/site_config/standard/7newsbelize.com.txt @@ -0,0 +1,7 @@ +title: //*[@id='sstitle'] +body: //div[@id='sstory'] +strip_id_or_class: newsoptions +prune: no + +test_url: http://www.7newsbelize.com/sstory.php?nid=25654 +test_url: http://www.7newsbelize.com/7news.xml \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/944.com.txt b/inc/3rdparty/site_config/standard/944.com.txt old mode 100644 new mode 100755 index 84380e7..8bf6a4c --- a/inc/3rdparty/site_config/standard/944.com.txt +++ b/inc/3rdparty/site_config/standard/944.com.txt @@ -1,9 +1,9 @@ -title: //h2[@class='border'] -body: //div[@class='padding'] - -convert_double_br_tags: yes - -strip: //div[@id='social_sharing'] -strip: //div[@class='socialLinks'] +title: //h2[@class='border'] +body: //div[@class='padding'] + +convert_double_br_tags: yes + +strip: //div[@id='social_sharing'] +strip: //div[@class='socialLinks'] test_url: http://www.944.com/articles/mild-obsessions-frock-la-get-to-know-victoria-tik-s-haute-sustainable-fashion-line/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/README.md b/inc/3rdparty/site_config/standard/README.md new file mode 100755 index 0000000..9040ba8 --- /dev/null +++ b/inc/3rdparty/site_config/standard/README.md @@ -0,0 +1,38 @@ +Full-Text RSS site config files +================ + +[Full-Text RSS](http://fivefilters.org/content-only/), our article extraction tool, makes use of site-specific extraction rules to improve results. Each time a URL is processed, it checks to see if there are extraction rules for the site being processed. If there are no site patterns, it tries to detect the content block automatically. + +This repository contains the site config files we use in Full-Text RSS. + +### Contributing changes + +We chose GitHub for this set of files because they offer one feature which we hope will make contributing changes easier: [file editing](https://github.com/blog/844-forking-with-the-edit-button) through the web interface. + +You can now make changes to any of our site config files and request that your changes be pulled into the main set we maintain. This is what GitHub calls the Fork and Pull model: + +> The Fork & Pull Model lets anyone fork an existing repository and push changes to their personal fork without requiring access be granted to the source repository. The changes must then be pulled into the source repository by the project maintainer. This model reduces the amount of friction for new contributors and is popular with open source projects because it allows people to work independently without upfront coordination. + +When we receive a pull request we'll review the changes and if everything's okay we'll update our copy. + +If a site is not in our set, you can create a file for it in the same way. See [Creating files on GitHub](https://github.com/blog/1327-creating-files-on-github). + +### How to write a site config file + +The quickest and simplest way is to use our [point-and-click interface](http://siteconfig.fivefilters.org). It's a simple tool only intended to create a rule to extract the correct content block. + +For further refinements, e.g. selecting the title, stripping elements, dealing with multi-page articles, please see our [help page](http://help.fivefilters.org/customer/portal/articles/223153-site-patterns). + +### Instapaper + +When we introduced site patterns, we chose to adopt the [same format](http://blog.instapaper.com/post/730281947) used by Instapaper. This allows us to make use of the existing extraction rules contributed by Instapaper users. + +Marco, Instapaper's creator, graciously opened up the database of contributions to everyone: + +> And, recognizing that your efforts could be useful to a wide range of other tools and services, I'll make the list of all of these site-specific configurations available to the public, free, with no strings attached. + +Most of the extraction rules in our set are borrowed from Instapaper. You can see the list maintained by Instapaper at [instapaper.com/bodytext/](http://instapaper.com/bodytext/) (login required). + +### Testing site config files + +Currently you will have to have a copy of Full-Text RSS to test changes to the site config files. In the future we will try to make this process easier. diff --git a/inc/3rdparty/site_config/standard/aachener-nachrichten.de.txt b/inc/3rdparty/site_config/standard/aachener-nachrichten.de.txt old mode 100644 new mode 100755 index 379592e..b60c15d --- a/inc/3rdparty/site_config/standard/aachener-nachrichten.de.txt +++ b/inc/3rdparty/site_config/standard/aachener-nachrichten.de.txt @@ -1,10 +1,10 @@ -title: //meta[@property='og:title']/@content -body: //*[@class='fliesstext_detail' or @class='detail_fliesstext'] | //img[@itemprop="image" and starts-with(@src, "/sixcms/media.php/")] - -strip_id_or_class: socialshareprivacy1 -strip_id_or_class: zvaFacebookButton - -tidy: no -prune: no - +title: //meta[@property='og:title']/@content +body: //*[@class='fliesstext_detail' or @class='detail_fliesstext'] | //img[@itemprop="image" and starts-with(@src, "/sixcms/media.php/")] + +strip_id_or_class: socialshareprivacy1 +strip_id_or_class: zvaFacebookButton + +tidy: no +prune: no + test_url: http://www.aachener-nachrichten.de/lokales/aachen-detail-an/2517757 \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/aachener-zeitung.de.txt b/inc/3rdparty/site_config/standard/aachener-zeitung.de.txt old mode 100644 new mode 100755 index 4d76fac..013afa4 --- a/inc/3rdparty/site_config/standard/aachener-zeitung.de.txt +++ b/inc/3rdparty/site_config/standard/aachener-zeitung.de.txt @@ -1,10 +1,10 @@ -title: //meta[@property='og:title']/@content -body: //*[@class='fliesstext_detail' or @class='detail_fliesstext'] | //img[@itemprop="image" and starts-with(@src, "/sixcms/media.php/")] - -strip_id_or_class: socialshareprivacy1 -strip_id_or_class: zvaFacebookButton - -tidy: no -prune: no - +title: //meta[@property='og:title']/@content +body: //*[@class='fliesstext_detail' or @class='detail_fliesstext'] | //img[@itemprop="image" and starts-with(@src, "/sixcms/media.php/")] + +strip_id_or_class: socialshareprivacy1 +strip_id_or_class: zvaFacebookButton + +tidy: no +prune: no + test_url: http://www.aachener-zeitung.de/sixcms/detail.php?template=az_detail&id=2552718 \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/abc.es.txt b/inc/3rdparty/site_config/standard/abc.es.txt old mode 100644 new mode 100755 index a99833d..43aadc4 --- a/inc/3rdparty/site_config/standard/abc.es.txt +++ b/inc/3rdparty/site_config/standard/abc.es.txt @@ -1,7 +1,7 @@ -title: //meta[@property='og:title']/@content -body: //div[@class='datosi' or @class='date' or @class='photo-alt1' or @class='text'] -strip_id_or_class: colB - -prune: no +title: //meta[@property='og:title']/@content +body: //div[@class='datosi' or @class='date' or @class='photo-alt1' or @class='text' or @itemprop='articleBody'] +strip_id_or_class: colB + +prune: no test_url: http://www.abc.es/20120209/tv-series/abci-house-ultima-temporada-201202090936.html \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/abc.net.au.txt b/inc/3rdparty/site_config/standard/abc.net.au.txt old mode 100644 new mode 100755 index 5e6269c..22b3a0f --- a/inc/3rdparty/site_config/standard/abc.net.au.txt +++ b/inc/3rdparty/site_config/standard/abc.net.au.txt @@ -1,10 +1,18 @@ -title: //h1 -author: //div[@class="byline"]/a -date: //span[@class="timestamp"] - -strip: //p[@class="topics"] -strip: //h1 -strip: //div[@class="byline"] -strip: //p[@class="published"] +title: //div[@class='article section']//h1 +author: //div[@class="byline"]/a +date: //span[@class="timestamp"] +body: //div[@class="page section"] + +strip: //a[@class="inline-caption"] +strip: //p[@class="ticker section noprint"] +strip: //p[@class="topics"] +strip: //h1 +strip: //div[@class="byline"] +strip: //p[@class="published"] strip: //div[contains(@class,"featured-scroller")] -test_url: http://www.abc.net.au/news/2011-11-08/crabb-carbon-legislation-abbott-demolition/3652544 \ No newline at end of file +strip_id_or_class: footer + +tidy: no + +test_url: http://www.abc.net.au/news/2013-03-27/open-speed-highways-change-clp-giles/4597892 +test_url: http://www.abc.net.au/news/2013-04-30/credit-growth-remains-subdued/4660054?section=business diff --git a/inc/3rdparty/site_config/standard/abcnews.go.com.txt b/inc/3rdparty/site_config/standard/abcnews.go.com.txt old mode 100644 new mode 100755 index c515d3e..8d36735 --- a/inc/3rdparty/site_config/standard/abcnews.go.com.txt +++ b/inc/3rdparty/site_config/standard/abcnews.go.com.txt @@ -1,27 +1,27 @@ -title: //h1[@class='headline'] -body: //div[@id='storyText'] -# for video entries -body: //img[@id='ff-img'] | //div[@id='meta']//div[contains(@class, 'overview')] -author: //div[@class='byline'] -date: //div[@class='date'] -strip: //*[@id='date_partner'] - -strip: //div[@class='breadcrumb'] -strip: //div[contains(@class,'show_tools')] -strip: //div[@id='sponsoredByAd'] -strip: //div[contains(@class,'rel_container')] -strip: //p[a[starts-with(@href, 'http://www.twitter.com')]] -strip: //p[a[starts-with(@href, 'http://www.facebook.com')]] -strip: //p[contains(., 'Click here to return to')] -#strip_id_or_class: media -strip_id_or_class: mediaplayer - -replace_string( -replace_string:
Price: - -strip_id_or_class: collapsePS -strip_id_or_class: expandPS -strip_id_or_class: psPlaceHolde -strip: //li[contains(., 'update product info') or contains(., 'give feedback on images')] - +title: //span[@id = 'btAsinTitle'] +body: (//*[@id='prodImageCell']//a)[1] | //div[@id = 'ps-content'] | //span[@id='actualPriceValue'] | //h2[.='Product Details']/following-sibling::div | //div[@class='h2' and .='Product Description']/following-sibling::div +#strip_id_or_class: quantityDropdownDiv +#strip_id_or_class: addToCartSpan +#strip_id_or_class: oneClickDiv +strip_id_or_class: nocontent +strip_id_or_class: masDynamicConten +strip_id_or_class: dynamic-content +prune: no + +find_string: +replace_string:
Price: + +strip_id_or_class: collapsePS +strip_id_or_class: expandPS +strip_id_or_class: psPlaceHolde +strip: //li[contains(., 'update product info') or contains(., 'give feedback on images')] + test_url: http://www.amazon.com/Common-Sense-Forestry-Living-Mother/dp/1931498210/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/americandrink.net.txt b/inc/3rdparty/site_config/standard/americandrink.net.txt old mode 100644 new mode 100755 index dee0e86..7145f3f --- a/inc/3rdparty/site_config/standard/americandrink.net.txt +++ b/inc/3rdparty/site_config/standard/americandrink.net.txt @@ -1,6 +1,6 @@ -title: //div[@class='head']/h2/a -author: //div[@class='head']/a -date: //div[@class='head']/p[@class='date']/a -body: //div[@class='copy'] +title: //div[@class='head']/h2/a +author: //div[@class='head']/a +date: //div[@class='head']/p[@class='date']/a +body: //div[@class='copy'] strip: //p[@class='meta'] test_url: http://americandrink.net/post/10567188712/free-the-hooch \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/americascup.com.txt b/inc/3rdparty/site_config/standard/americascup.com.txt old mode 100644 new mode 100755 index b1673b6..31723f8 --- a/inc/3rdparty/site_config/standard/americascup.com.txt +++ b/inc/3rdparty/site_config/standard/americascup.com.txt @@ -1,10 +1,10 @@ -title: //div[@class="editorial-content"]/h3 -body: //div[@class="hero-image" or @class="editorial-content"] - -strip: //ul[@class="hero-caption"] -strip_id_or_class: footer - -prune: no -tidy: no - +title: //div[@class="editorial-content"]/h3 +body: //div[@class="hero-image" or @class="editorial-content"] + +strip: //ul[@class="hero-caption"] +strip_id_or_class: footer + +prune: no +tidy: no + test_url: http://www.americascup.com/en/Latest/News/2012/3/Coutts-and-Peyron-tell-transformative-tale-at-Global-Sports-Forum/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/americastestkitchenfeed.com.txt b/inc/3rdparty/site_config/standard/americastestkitchenfeed.com.txt old mode 100644 new mode 100755 index 8bf31ec..c2b62b5 --- a/inc/3rdparty/site_config/standard/americastestkitchenfeed.com.txt +++ b/inc/3rdparty/site_config/standard/americastestkitchenfeed.com.txt @@ -1,5 +1,5 @@ -title: //h1[@class="post-title"] -author: //span[@class="author"]/a -date: //span[@class="date"] +title: //h1[@class="post-title"] +author: //span[@class="author"]/a +date: //span[@class="date"] body: //div[@class="post-content main"] test_url: http://www.americastestkitchenfeed.com/gadgets-and-gear/2012/07/chill-out-with-tovolos-king-cube-silicone-ice-cube-tray/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/amptoons.com.txt b/inc/3rdparty/site_config/standard/amptoons.com.txt new file mode 100755 index 0000000..87547c6 --- /dev/null +++ b/inc/3rdparty/site_config/standard/amptoons.com.txt @@ -0,0 +1,8 @@ +title: //title + +body: //div[@class="entry-content"] + +author: //span[@class="author vcard"] + +date: //span[@class="entry-date"] +test_url: http://www.amptoons.com/blog/2013/03/14/open-thread-and-link-farm-i-hate-being-sick-edition/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/anandtech.com.txt b/inc/3rdparty/site_config/standard/anandtech.com.txt old mode 100644 new mode 100755 index 8067e03..7d80491 --- a/inc/3rdparty/site_config/standard/anandtech.com.txt +++ b/inc/3rdparty/site_config/standard/anandtech.com.txt @@ -1,11 +1,11 @@ -author: //a[@class='b'][1] -date: substring-after(substring-before(//div, 'Posted in'), ' on ') -strip_image_src: /content/images/globals/ -strip: //h2[. = 'Page 1']/preceding::p -strip: //h2 - -prune: no - -single_page_link: concat('http://www.anandtech.com/print/', substring-after(//meta[@property='og:url']/@content, '/show/')) - +author: //a[@class='b'][1] +date: substring-after(substring-before(//div, 'Posted in'), ' on ') +strip_image_src: /content/images/globals/ +strip: //h2[. = 'Page 1']/preceding::p +strip: //h2 + +prune: no + +single_page_link: concat('http://www.anandtech.com/print/', substring-after(//meta[@property='og:url']/@content, '/show/')) + test_url: http://www.anandtech.com/show/5812/eurocom-monster-10-clevos-little-monster/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/androidpolice.com.txt b/inc/3rdparty/site_config/standard/androidpolice.com.txt new file mode 100755 index 0000000..8f9b1a2 --- /dev/null +++ b/inc/3rdparty/site_config/standard/androidpolice.com.txt @@ -0,0 +1,5 @@ +body: //div[@class='post_content'] +date: //div[@class='date_day'] | div[@class='date_month'] + +test_url: http://www.androidpolice.com/2014/03/30/music-boss-for-pebble-can-now-control-playback-and-volume-on-chromecast-content-from-your-smartwatch/ + diff --git a/inc/3rdparty/site_config/standard/andyrutledge.com.txt b/inc/3rdparty/site_config/standard/andyrutledge.com.txt old mode 100644 new mode 100755 index f9ffd3c..ce31fcf --- a/inc/3rdparty/site_config/standard/andyrutledge.com.txt +++ b/inc/3rdparty/site_config/standard/andyrutledge.com.txt @@ -1,9 +1,9 @@ -title: //h2 -author: string('Andy Rutledge') -date: //div[@class='articledate'] -body: //div[@class='copybody'] - -strip: //*[@class='space'] -strip: //*[@class='articleFoot'] - +title: //h2 +author: string('Andy Rutledge') +date: //div[@class='articledate'] +body: //div[@class='copybody'] + +strip: //*[@class='space'] +strip: //*[@class='articleFoot'] + test_url: http://www.andyrutledge.com/hungry-for-a-better-menu.php \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/annatravelling.wordpress.com.txt b/inc/3rdparty/site_config/standard/annatravelling.wordpress.com.txt old mode 100644 new mode 100755 index a5c7c08..2d8937f --- a/inc/3rdparty/site_config/standard/annatravelling.wordpress.com.txt +++ b/inc/3rdparty/site_config/standard/annatravelling.wordpress.com.txt @@ -1,9 +1,9 @@ -title: //h1[@class="title"] - -author: ("Anna Manasova") -# is ignored, unfortunately - -date: //p[@class="date"] - +title: //h1[@class="title"] + +author: ("Anna Manasova") +# is ignored, unfortunately + +date: //p[@class="date"] + body: //div[@class="entry"] test_url: http://annatravelling.wordpress.com/2011/11/07/a-day-of-cooking-thai/ \ No newline at end of file diff --git a/inc/3rdparty/site_config/standard/applature.com.txt b/inc/3rdparty/site_config/standard/applature.com.txt old mode 100644 new mode 100755 index a78a615..a820bba --- a/inc/3rdparty/site_config/standard/applature.com.txt +++ b/inc/3rdparty/site_config/standard/applature.com.txt @@ -1,18 +1,18 @@ -title: //h1[contains(@class, 'title')# -body: //div[@id='mainContent']//div[contains(@class, 'section_content')] | //ul[@class='section_footer'] -date: //div[@class='date'] - -strip_id_or_class: sharethis -strip_id_or_class: stats -strip_id_or_class: apply_form -strip_id_or_class: job_map -strip_id_or_class: respond -strip: //h1//span[@class='type'] -strip: //li[@class='print' or @class='map'] - -replace_string(