summaryrefslogtreecommitdiffstats
path: root/3rdparty/fguillot
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/fguillot')
-rw-r--r--3rdparty/fguillot/picofeed/.gitignore3
-rw-r--r--3rdparty/fguillot/picofeed/.travis.yml4
-rw-r--r--3rdparty/fguillot/picofeed/README.markdown9
-rw-r--r--3rdparty/fguillot/picofeed/docs/feed-parsing.markdown269
-rw-r--r--3rdparty/fguillot/picofeed/docs/installation.markdown71
-rw-r--r--3rdparty/fguillot/picofeed/docs/tests.markdown14
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/Client.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Client.php)85
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/ClientException.php16
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/Curl.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Clients/Curl.php)64
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/Favicon.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Favicon.php)33
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/Grabber.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Grabber.php)15
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/InvalidCertificateException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/InvalidUrlException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/MaxRedirectException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/MaxSizeException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/Stream.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Clients/Stream.php)15
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/TimeoutException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Client/Url.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Url.php)4
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Config/Config.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Config.php)46
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Encoding/Encoding.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Encoding.php)2
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Filter/Attribute.php27
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Filter/Filter.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Filter.php)43
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Filter/Html.php15
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Filter/Tag.php2
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Logging/Logging.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Logging.php)16
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Atom.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Parsers/Atom.php)63
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Feed.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Feed.php)4
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Item.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Item.php)4
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/MalformedXmlException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Parser.php)259
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/ParserException.php16
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss10.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Parsers/Rss10.php)33
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss20.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Parsers/Rss20.php)67
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss91.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/Rss92.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/XmlParser.php)4
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parsers/Rss91.php17
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Parsers/Rss92.php17
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/PicoFeed.php25
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/PicoFeedException.php15
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Reader.php310
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Reader/Reader.php232
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Reader/ReaderException.php16
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Reader/SubscriptionNotFoundException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Reader/UnsupportedFeedFormatException.php13
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Serialization/Export.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Export.php)4
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Serialization/Import.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Import.php)7
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Syndication/Atom.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Writers/Atom.php)5
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Syndication/Rss20.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Writers/Rss20.php)5
-rw-r--r--3rdparty/fguillot/picofeed/lib/PicoFeed/Syndication/Writer.php (renamed from 3rdparty/fguillot/picofeed/lib/PicoFeed/Writer.php)4
-rw-r--r--3rdparty/fguillot/picofeed/phpunit.xml2
-rwxr-xr-x3rdparty/fguillot/picofeed/picofeed6
-rw-r--r--3rdparty/fguillot/picofeed/tests/Client/ClientTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ClientTest.php)10
-rw-r--r--3rdparty/fguillot/picofeed/tests/Client/CurlTest.php (renamed from 3rdparty/fguillot/picofeed/tests/CurlTest.php)41
-rw-r--r--3rdparty/fguillot/picofeed/tests/Client/FaviconTest.php (renamed from 3rdparty/fguillot/picofeed/tests/FaviconTest.php)5
-rw-r--r--3rdparty/fguillot/picofeed/tests/Client/GrabberTest.php (renamed from 3rdparty/fguillot/picofeed/tests/GrabberTest.php)18
-rw-r--r--3rdparty/fguillot/picofeed/tests/Client/StreamTest.php (renamed from 3rdparty/fguillot/picofeed/tests/StreamTest.php)34
-rw-r--r--3rdparty/fguillot/picofeed/tests/Client/UrlTest.php (renamed from 3rdparty/fguillot/picofeed/tests/UrlTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/Filter/AttributeFilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/AttributeFilterTest.php)7
-rw-r--r--3rdparty/fguillot/picofeed/tests/Filter/FilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/FilterTest.php)7
-rw-r--r--3rdparty/fguillot/picofeed/tests/Filter/HtmlFilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/HtmlFilterTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/TagFilterTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/AtomParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/AtomParserTest.php)76
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ParserTest.php)30
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/Rss10ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss10ParserTest.php)39
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/Rss20ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss20ParserTest.php)114
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/Rss91ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss91ParserTest.php)8
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/Rss92ParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss92ParserTest.php)17
-rw-r--r--3rdparty/fguillot/picofeed/tests/Parser/XmlParserTest.php (renamed from 3rdparty/fguillot/picofeed/tests/XmlParserTest.php)6
-rw-r--r--3rdparty/fguillot/picofeed/tests/Reader/ReaderTest.php157
-rw-r--r--3rdparty/fguillot/picofeed/tests/ReaderTest.php108
-rw-r--r--3rdparty/fguillot/picofeed/tests/Serialization/ExportTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ExportTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/Serialization/ImportTest.php (renamed from 3rdparty/fguillot/picofeed/tests/ImportTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/Syndication/AtomWriterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/AtomWriterTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/Syndication/Rss20WriterTest.php (renamed from 3rdparty/fguillot/picofeed/tests/Rss20WriterTest.php)4
-rw-r--r--3rdparty/fguillot/picofeed/tests/fixtures/groovehq.xml1767
-rw-r--r--3rdparty/fguillot/picofeed/tests/fixtures/womensweardaily.xml63
77 files changed, 3220 insertions, 1313 deletions
diff --git a/3rdparty/fguillot/picofeed/.gitignore b/3rdparty/fguillot/picofeed/.gitignore
index 496ee2ca6..b0ef0680a 100644
--- a/3rdparty/fguillot/picofeed/.gitignore
+++ b/3rdparty/fguillot/picofeed/.gitignore
@@ -1 +1,2 @@
-.DS_Store \ No newline at end of file
+.DS_Store
+vendor/ \ No newline at end of file
diff --git a/3rdparty/fguillot/picofeed/.travis.yml b/3rdparty/fguillot/picofeed/.travis.yml
index 83334e8c4..0c3d0fe55 100644
--- a/3rdparty/fguillot/picofeed/.travis.yml
+++ b/3rdparty/fguillot/picofeed/.travis.yml
@@ -7,4 +7,6 @@ php:
- "5.3"
before_script: wget https://phar.phpunit.de/phpunit.phar
-script: php phpunit.phar
+script:
+ - composer dump-autoload
+ - php phpunit.phar
diff --git a/3rdparty/fguillot/picofeed/README.markdown b/3rdparty/fguillot/picofeed/README.markdown
index 99ef68237..8f01b4e8e 100644
--- a/3rdparty/fguillot/picofeed/README.markdown
+++ b/3rdparty/fguillot/picofeed/README.markdown
@@ -38,17 +38,20 @@ Authors
-------
- Original author: [Frédéric Guillot](http://fredericguillot.com/)
-- Contributors: See pull-requests, issues tracker and commit history
+- Major Contributors:
+ - [Bernhard Posselt](https://github.com/Raydiation)
+ - [David Pennington](https://github.com/Xeoncross)
Documentation
-------------
- [Installation](docs/installation.markdown)
-- [OPML file importation](docs/opml-import.markdown)
-- [OPML file exportation](docs/opml-export.markdown)
+- [Running unit tests](docs/tests.markdown)
- [Feed parsing](docs/feed-parsing.markdown)
- [Feed creation](docs/feed-creation.markdown)
- [Favicon fetcher](docs/favicon.markdown)
+- [OPML file importation](docs/opml-import.markdown)
+- [OPML file exportation](docs/opml-export.markdown)
- [Web scraping](docs/grabber.markdown)
- [Debugging](docs/debugging.markdown)
- [Configuration](docs/config.markdown)
diff --git a/3rdparty/fguillot/picofeed/docs/feed-parsing.markdown b/3rdparty/fguillot/picofeed/docs/feed-parsing.markdown
index 10f20d31a..22f84339b 100644
--- a/3rdparty/fguillot/picofeed/docs/feed-parsing.markdown
+++ b/3rdparty/fguillot/picofeed/docs/feed-parsing.markdown
@@ -1,205 +1,164 @@
Feed parsing
============
-Download and parse a feed
--------------------------
-
-Try this example from a command line script:
+Parsing a subscription
+----------------------
```php
-<?php
-
-require 'path/to/PicoFeed.php';
-
-use PicoFeed\Reader;
+use PicoFeed\Reader\Reader;
+use PicoFeed\PicoFeedException;
-$reader = new Reader;
+try {
-// Try to discover the XML feed automatically
-$reader->download('http://bbc.co.uk/news');
+ $reader = new Reader;
-$parser = $reader->getParser();
+ // Return a resource
+ $resource = $reader->download('https://linuxfr.org/news.atom');
-if ($parser !== false) {
+ // Return the right parser instance according to the feed format
+ $parser = $reader->getParser(
+ $resource->getUrl(),
+ $resource->getContent(),
+ $resource->getEncoding()
+ );
+ // Return a Feed object
$feed = $parser->execute();
- if ($feed !== false) {
- echo $feed;
- }
+ // Print the feed properties with the magic method __toString()
+ echo $feed;
+}
+catch (PicoFeedException $e) {
+ // Do Something...
}
```
-- The method `getParser()` return `false` when there is something wrong during the download or the feed detection
-- The call `$parser->execute()` return `false` when there is a parsing error
-
-In your terminal you will got an output like that:
-
-```
-Feed::id = http://www.bbc.co.uk/news/#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa
-Feed::title = BBC News - Home
-Feed::url = http://www.bbc.co.uk/news/#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa
-Feed::date = 1399934742
-Feed::language = en-gb
-Feed::items = 84 items
+- The Reader class is the entry point for feed reading
+- The method `download()` fetch the remote content and return a resource, an instance of `PicoFeed\Client\Client`
+- The method `getParser()` returns a Parser instance according to the feed format Atom, Rss 2.0...
+- The parser itself returns a `Feed` object that contains feed and item properties
+
+Output:
+
+```bash
+Feed::id = tag:linuxfr.org,2005:/news
+Feed::title = LinuxFr.org : les dépêches
+Feed::url = http://linuxfr.org/news
+Feed::date = 1415138079
+Feed::language = en-US
+Feed::description =
+Feed::logo =
+Feed::items = 15 items
----
-Item::id = e411a646
-Item::title = Nigeria rejects captive girls 'swap'
-Item::url = http://www.bbc.co.uk/news/world-africa-27386285#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa
-Item::date = 1399933404
-Item::language = en-gb
-Item::author =
+Item::id = 38d8f48284fb03940cbb3aff9101089b81e44efb1281641bdd7c3e7e4bf3b0cd
+Item::title = openSUSE 13.2 : nouvelle version du caméléon disponible !
+Item::url = http://linuxfr.org/news/opensuse-13-2-nouvelle-version-du-cameleon-disponible
+Item::date = 1415122640
+Item::language = en-US
+Item::author = Syvolc
Item::enclosure_url =
Item::enclosure_type =
-Item::content = <p>Nigeria insists i... (152 bytes)
+Item::content = 18307 bytes
----
-Item::id = 6c50fcf2
-Item::title = Woman tells of Harris 'assaults'
-Item::url = http://www.bbc.co.uk/news/uk-27371573#sa-ns_mchannel=rss&ns_source=PublicRSS20-sa
-Item::date = 1399908906
-Item::language = en-gb
-Item::author =
+Item::id = d0ebddc90bfc3f109f9be00a3bb0b4a770af7a647cdc88454fe15d79168e0dea
+Item::title = Fuzix OS, parce que les petites choses sont belles
+Item::url = http://linuxfr.org/news/fuzix-os-parce-que-les-petites-choses-sont-belles
+Item::date = 1415112167
+Item::language = en-US
+Item::author = Thomas DEBESSE
Item::enclosure_url =
Item::enclosure_type =
-Item::content = <p>A woman tells the... (142 bytes)
-...........
-```
-
-This ouput is generated by the magic method `__toString()` of the class `Feed` and `Item`.
-All properties are public and they are also available with getter methods:
-
-```php
-
-// Examples for the feed:
-echo $feed->getId(); // Unique feed id
-echo $feed->getTitle(); // Feed title
-echo $feed->getUrl(); // Feed url
-echo $feed->getDate(); // Feed last updated date
-echo $feed->getLanguage(); // Feed language
-echo $feed->getDescription(); // Feed description
-echo $feed->getLogo(); // Feed logo (can be a large image, different from icon)
-echo $feed->getItems(); // List of items
-
-// Examples for items:
-echo $feed->items[0]->getId();
-echo $feed->items[0]->getTitle();
-echo $feed->items[0]->getUrl();
-echo $feed->items[0]->getDate();
-echo $feed->items[0]->getLanguage();
-echo $feed->items[0]->getAuthor();
-echo $feed->items[0]->getEnclosureUrl();
-echo $feed->items[0]->getEnclosureType();
-echo $feed->items[0]->getContent();
+Item::content = 6104 bytes
+....
```
-Handle HTTP cache
------------------
-
-To avoid downloading and parsing the feed each time, it's a good idea to handle the HTTP caching:
+Get the list of available subscriptions for a website
+-----------------------------------------------------
-1. After the first HTTP request, we save somewhere (in a database) the headers Etag and Last-Modified for the next checks
-2. If the feed is not modified, we don't need to parse again the feed
-
-Example:
+The example below will returns all available subscriptions for the website:
```php
-use PicoFeed\Reader;
-
-$reader = new Reader;
+use PicoFeed\Reader\Reader;
-// Get last modified infos from previous requests
-$lastModified = '...';
-$etag = '...';
+try {
-// Download directly the feed
-$resource = $reader->download('http://linuxfr.org/news.atom', $lastModified, $etag);
+ $reader = new Reader;
+ $resource = $reader->download('http://www.cnn.com');
-// Return true is the feed has changed
-if ($resource->isModified()) {
+ $feeds = $reader->find(
+ $resource->getUrl(),
+ $resource->getContent()
+ );
- $parser = $reader->getParser();
-
- if ($parser !== false) {
-
- $feed = $parser->execute();
-
- if ($feed !== false) {
-
- // Save cache infos for the next request
- $lastModified = $resource->getLastModified();
- $etag = $resource->getEtag();
- }
- }
+ print_r($feeds);
+}
+catch (PicoFeedException $e) {
+ // Do something...
}
```
-Use a custom user agent
------------------------
-
-You have to define a custom configuration for that:
+Output:
```php
-use PicoFeed\Reader;
-use PicoFeed\Config;
-
-$config = new Config;
-$config->setClientUserAgent('My RSS Reader');
-
-$reader = new Reader($config);
-...
+Array
+(
+ [0] => http://rss.cnn.com/rss/cnn_topstories.rss
+ [1] => http://rss.cnn.com/rss/cnn_latest.rss
+)
```
-The complete config parameters are [described here](config.markdown).
+Feed discovery and parsing
+--------------------------
-Set a custom timezone
----------------------
-
-By default, the timezone used is UTC but you can define a custom timezone for