diff --git a/vendor/autoload.php b/vendor/autoload.php
index 116aa8b..fd5712e 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInita56cecf18737d4c6655b021e5f21a1a6::getLoader();
+return ComposerAutoloaderInit8ccf24e95a95febb275803014c1c9a9a::getLoader();
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 3fed2d2..d6458f8 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInita56cecf18737d4c6655b021e5f21a1a6
+class ComposerAutoloaderInit8ccf24e95a95febb275803014c1c9a9a
{
private static $loader;
@@ -19,9 +19,9 @@ class ComposerAutoloaderInita56cecf18737d4c6655b021e5f21a1a6
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInita56cecf18737d4c6655b021e5f21a1a6', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit8ccf24e95a95febb275803014c1c9a9a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInita56cecf18737d4c6655b021e5f21a1a6', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit8ccf24e95a95febb275803014c1c9a9a', 'loadClassLoader'));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInita56cecf18737d4c6655b021e5f21a1a6
$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
- composerRequirea56cecf18737d4c6655b021e5f21a1a6($file);
+ composerRequire8ccf24e95a95febb275803014c1c9a9a($file);
}
return $loader;
}
}
-function composerRequirea56cecf18737d4c6655b021e5f21a1a6($file)
+function composerRequire8ccf24e95a95febb275803014c1c9a9a($file)
{
require $file;
}
diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json
index c35838e..68acbff 100644
--- a/vendor/composer/installed.json
+++ b/vendor/composer/installed.json
@@ -162,12 +162,12 @@
"source": {
"type": "git",
"url": "https://github.com/fguillot/picoFeed.git",
- "reference": "acc16f1a0854fdaeae2416f1b12ee51a9c150b52"
+ "reference": "8973f403ff6c16fb5200cfac44a58111c564b60d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/acc16f1a0854fdaeae2416f1b12ee51a9c150b52",
- "reference": "acc16f1a0854fdaeae2416f1b12ee51a9c150b52",
+ "url": "https://api.github.com/repos/fguillot/picoFeed/zipball/8973f403ff6c16fb5200cfac44a58111c564b60d",
+ "reference": "8973f403ff6c16fb5200cfac44a58111c564b60d",
"shasum": ""
},
"require": {
@@ -181,7 +181,7 @@
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
- "time": "2015-03-19 22:19:36",
+ "time": "2015-03-25 18:09:25",
"bin": [
"picofeed"
],
diff --git a/vendor/fguillot/picofeed/docs/feed-parsing.markdown b/vendor/fguillot/picofeed/docs/feed-parsing.markdown
index 6e7f2fd..363156c 100644
--- a/vendor/fguillot/picofeed/docs/feed-parsing.markdown
+++ b/vendor/fguillot/picofeed/docs/feed-parsing.markdown
@@ -205,6 +205,45 @@ $feed->items[0]->getContent(); // Item content (filtered or raw)
$feed->items[0]->isRTL(); // Return true if the item language is Right-To-Left
```
+Get raw XML tags/attributes or non standard tags for items
+----------------------------------------------------------
+
+Get the original `guid` tag for RSS 2.0 feeds:
+
+```php
+echo $feed->items[0]->getTag('guid');
+```
+
+Get a specific attribute value:
+
+```php
+echo $feed->items[1]->getTag('category', 'term');
+```
+
+Get value of namespaced tag:
+
+```php
+echo $feed->items[1]->getTag('wfw:commentRss');
+```
+
+Get attribute value of a namespaced tag:
+
+```php
+echo $feed->items[0]->getTag('media:content', 'url');
+```
+
+Get the xml of the item (returns a SimpleXMLElement instance):
+
+```php
+$simplexml = $feed->items[0]->xml;
+```
+
+Get the list of namespaces:
+
+```php
+print_r($feed->items[0]->namespaces);
+```
+
RTL language detection
----------------------
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php
index 1585131..d891ef4 100644
--- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php
+++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php
@@ -99,6 +99,47 @@ class Item
*/
public $language = '';
+ /**
+ * Raw XML
+ *
+ * @access public
+ * @var \SimpleXMLElement
+ */
+ public $xml;
+
+ /**
+ * List of namespaces
+ *
+ * @access public
+ * @var array
+ */
+ public $namespaces = array();
+
+ /**
+ * Get specific XML tag or attribute value
+ *
+ * @access public
+ * @param string $tag Tag name (examples: guid, media:content)
+ * @param string $attribute Tag attribute
+ * @return string
+ */
+ public function getTag($tag, $attribute = '')
+ {
+ // Get namespaced value
+ if (strpos($tag, ':') !== false) {
+ list(,$tag) = explode(':', $tag);
+ return XmlParser::getNamespaceValue($this->xml, $this->namespaces, $tag, $attribute);
+ }
+
+ // Return attribute value
+ if (! empty($attribute)) {
+ return (string) $this->xml->{$tag}[$attribute];
+ }
+
+ // Return tag content
+ return (string) $this->xml->$tag;
+ }
+
/**
* Return item information
*
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php
index 4d45f53..7ef904f 100644
--- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php
+++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Parser.php
@@ -153,6 +153,9 @@ abstract class Parser
foreach ($this->getItemsTree($xml) as $entry) {
$item = new Item;
+ $item->xml = $entry;
+ $item->namespaces = $this->namespaces;
+
$this->findItemAuthor($xml, $entry, $item);
$this->findItemUrl($entry, $item);
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php
index 2c68c50..feda8c2 100644
--- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php
+++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php
@@ -212,21 +212,7 @@ class XmlParser
}
/**
- * Extract charset from meta tag
- *
- * @static
- * @access public
- * @param string $data meta tag content
- * @return string
- */
- public static function findCharset($data)
- {
- $result = explode('charset=', $data);
- return isset($result[1]) ? $result[1] : $data;
- }
-
- /**
- * Get the encoding from a xml tag
+ * Get the charset from a meta tag
*
* @static
* @access public
@@ -237,18 +223,8 @@ class XmlParser
{
$encoding = '';
- $dom = static::getHtmlDocument($data);
- $xpath = new DOMXPath($dom);
-
- $tags = array(
- '/html/head/meta[translate(@http-equiv, "CENOPTY", "cenopty")="content-type"]/@content', //HTML4, convert upper to lower-case
- '/html/head/meta/@charset', //HTML5
- );
-
- $nodes = $xpath->query(implode(' | ', $tags));
-
- foreach ($nodes as $node) {
- $encoding = static::findCharset($node->nodeValue);
+ if (preg_match('/