]> git.wh0rd.org Git - tt-rss.git/commitdiff
parser: add basic support for media:thumbnail
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 15 Dec 2013 08:35:30 +0000 (12:35 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 15 Dec 2013 08:35:30 +0000 (12:35 +0400)
classes/feeditem/atom.php
classes/feeditem/rss.php

index 5f0400feacd00574c30b1a005818373af5cc873c..244fb1f84671ac61de286ea06ea8441f2e0b4b07 100644 (file)
@@ -175,6 +175,17 @@ class FeedItem_Atom extends FeedItem_Common {
                        array_push($encs, $enc);
                }
 
+               $enclosures = $this->xpath->query("media:thumbnail", $this->elem);
+
+               foreach ($enclosures as $enclosure) {
+                       $enc = new FeedEnclosure();
+
+                       $enc->type = "image/generic";
+                       $enc->link = $enclosure->getAttribute("url");
+
+                       array_push($encs, $enc);
+               }
+
                return $encs;
        }
 
index b5d9695e28ccf30ea988db445cbc222176861e1e..f632d3bbfe2617d43319f00ab9cbdc740f938219 100644 (file)
@@ -150,6 +150,17 @@ class FeedItem_RSS extends FeedItem_Common {
                        array_push($encs, $enc);
                }
 
+               $enclosures = $this->xpath->query("media:thumbnail", $this->elem);
+
+               foreach ($enclosures as $enclosure) {
+                       $enc = new FeedEnclosure();
+
+                       $enc->type = "image/generic";
+                       $enc->link = $enclosure->getAttribute("url");
+
+                       array_push($encs, $enc);
+               }
+
                return $encs;
        }