RSS marquee

precisely how could i work with rss feeds to help populate a marquee no exp with xml.

Dorky,
Give us a connection to your XML (RSS Feed).
Here are a few quirks about XML… so easily could see this feed,
I might have a very sample script you can try.

sorry ml i dont employ a chosen source however. it is something i used to be considering for of which chat site post revamped, by how is looking much better now http: //www. citicommons. com. but yeah my partner and i dont really have learned to get started on doing this, so im spacious for a point inside right direction. thx ahead of time.

Some feeds are easy to accomplish, others have malformed XML and the like use ATOM.
Therefore, the required code will vary between them.

For example, this is some sort of script that makes use of CURL:

PHP:


< php 
//  rss  page  for  Co  - 
$feed_url  "http: //www. weather conditions. gov/alerts/co. rss";  

#  INITIATE  SNUGGLE.
$curl  curl_init();

#  CURL  CONFIGURATIONS.
curl_setopt($curl,   CURLOPT_URL, "$feed_url");
curl_setopt($curl,   CURLOPT_RETURNTRANSFER,   1);
curl_setopt($curl,   CURLOPT_CONNECTTIMEOUT,   0);

#  GRAB  THE  XML  DOCUMENT.
$xmlTwitter  curl_exec($curl);

curl_close($curl);

#  SET  UP  XML  SUBJECT.
$xml  =  new  SimpleXMLElement($xmlTwitter);

//echo  "< pre> ";  
//print_r($xml);  
//echo  "< /pre> ";  

foreach  ($xml-> channel-> item  as  $item)   
      echo 
"Title:   $item-> title< br  /> ";  
      echo 
"Description:   "  .   nl2br(trim($item-> description, "\r\n")) .   "< br  /> < br  /> ";  
 
>  

This place does not utilize CURL:

PHP:


< php

function  get_string_between($string,   $start,   $end)
               
$string  "  ". $string;
               
$ini  strpos($string, $start);
                if  (
$ini  ==  0)  return  "";
               
$ini  +=  strlen($start);      
               
$len  strpos($string, $end, $ini)  -  $ini;
                return 
substr($string, $ini, $len);

                $feed_url  "http: //www. amazon. company. uk/rss/bestsellers/videogamestag=AssocID-21";

//  Get  XML 
$xml=simplexml_load_file($feed_url);

//  How  many  items  to  display  from  the  RSS  Feed ...
$count  3;  

foreach  ($xml-> channel-> item  as  $item
 
//  Parse-out  the  photo  for  each  item ...
$photo  get_string_between($item-> description,   'AssocID-21"> ', '< /a> ');

//  Parse-out  the  cost  for  each  item  (buy  new  and  crossed-out  prices) ...
$costs  get_string_between<

This entry was posted in Web Design and tagged , , , , , , , , , , , , . Bookmark the permalink.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *