Login   Register  
PHP Classes
elePHPant
Icontem

File: example_RSS.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Armin Randjbar-Daemi  >  simpleTagReader  >  example_RSS.php  >  Download  
File: example_RSS.php
Role: Example script
Content type: text/plain
Description: example
Class: simpleTagReader
Extract values from tag based documents
Author: By
Last change:
Date: 2008-05-19 12:24
Size: 578 bytes
 

Contents

Class file image Download
<?php
// read current weather conditions in Tabriz/Iran from Yahoo! Weather
require_once('class.simpleTagReader.php');

$City "IRXX0016";
$Unit "c"// c or f
$yahooWeather = new simpleTagReader('http://xml.weather.yahoo.com/forecastrss?p='.$City.'&u='.$Unit.'');

$result $yahooWeather->readAllTags('description');//first Tag: $result[0] & Second(Last) Tag: $result[1]
echo substr($result[1], 9, -3);

echo 
"<br />OR<br />";

$result $yahooWeather->readTag('description'2);//to read first Tag: $yahooWeather->readTag('description', 1);
echo substr($result9, -3);
?>