danyboy2010
01-08-2007, 03:51 AM
Hello
I have a script that use http://lastrss.oslab.net/lastRSS.phps to parse content
The problem is that dont recognize <enclosure tag .Can take images
only from <image> tag
var $channeltags = array ('title', 'link', 'description', 'language', 'copyright', 'managingEditor', 'webMaster', 'lastBuildDate', 'rating', 'docs');
var $itemtags = array('title', 'link', 'description', 'author', 'category', 'comments', 'enclosure', 'guid', 'pubDate', 'source','image', 'thumb');
var $imagetags = array('title', 'url', 'link', 'width', 'height');
var $textinputtags = array('title', 'description', 'name', 'link');
// Parse IMAGE info
preg_match("'<image.*?>(.*?)</image>'si", $rss_content, $out_imageinfo);
if (isset($out_imageinfo[1])) {
foreach($this->imagetags as $imagetag) {
$temp = $this->my_preg_match("'<$imagetag.*?>(.*?)</$imagetag>'si", $out_imageinfo[1]);
if ($temp != '') $result['image_'.$imagetag] = $temp; // Set only if not empty
}
I think here is the problem preg_match("'<image.*?>(.*?)</image>'si", $rss_content, $out_imageinfo);
Can somebody help me so i can make it to take the images from <enclosure tag too ?
<item><title>Title</title><link>http://link</link><pubDate>Date</pubDate><description>Description</description><category>Category</category><enclosure url="http://www.site.com/images/img.jpg" type="image/jpeg" length="10000" /></item>
I have a script that use http://lastrss.oslab.net/lastRSS.phps to parse content
The problem is that dont recognize <enclosure tag .Can take images
only from <image> tag
var $channeltags = array ('title', 'link', 'description', 'language', 'copyright', 'managingEditor', 'webMaster', 'lastBuildDate', 'rating', 'docs');
var $itemtags = array('title', 'link', 'description', 'author', 'category', 'comments', 'enclosure', 'guid', 'pubDate', 'source','image', 'thumb');
var $imagetags = array('title', 'url', 'link', 'width', 'height');
var $textinputtags = array('title', 'description', 'name', 'link');
// Parse IMAGE info
preg_match("'<image.*?>(.*?)</image>'si", $rss_content, $out_imageinfo);
if (isset($out_imageinfo[1])) {
foreach($this->imagetags as $imagetag) {
$temp = $this->my_preg_match("'<$imagetag.*?>(.*?)</$imagetag>'si", $out_imageinfo[1]);
if ($temp != '') $result['image_'.$imagetag] = $temp; // Set only if not empty
}
I think here is the problem preg_match("'<image.*?>(.*?)</image>'si", $rss_content, $out_imageinfo);
Can somebody help me so i can make it to take the images from <enclosure tag too ?
<item><title>Title</title><link>http://link</link><pubDate>Date</pubDate><description>Description</description><category>Category</category><enclosure url="http://www.site.com/images/img.jpg" type="image/jpeg" length="10000" /></item>
