Login   Register  
PHP Classes

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Anis uddin ahmad  >  PHP Universal Feed Parser  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example of parsing sitepoint rss
Class: PHP Universal Feed Parser
Parse RSS and ATOM feeds
Author: By
Last change: Some links are updated
Date: 6 years ago
Size: 1,653 bytes


Class file image Download
$Parser     = new FeedParser();


$channels      $Parser->getChannels();     
$items         $Parser->getItems();        

<html xmlns="http://www.w3.org/1999/xhtml">
    <title>Testing the PHP Universal Feed Parser</title>
    <style type="text/css">
        padding: 0px;
        margin: 50px 150px;
        border: 1px solid #ddd;
        font-family: verdana, arial;
    h1#title {
        background-color: #eee;
        border-bottom : 1px solid #ddd;
        margin: 0px 0px 15px;
        text-align: center;
    h1#title a{
        font-size: 18px;
    p, a{
        padding: 5px;
        margin: 5px;
        font-size: 12px;
        font-size: 13px;
        font-weight: bold;
        border-bottom : 1px solid #ddd;
        color: 1px solid #f6afab;
        padding: 5px;
        text-align: center;
        color: #444;
    <h1 id="title"><a href="<?php echo $channels['LINK']; ?>"><?php echo $channels['TITLE']; ?></a></h1>
    <p id="description"><?php echo $channels['DESCRIPTION']; ?> </p>
    <?php foreach($items as $item): ?>
        <a class="feed-title" href="<?php echo $item['LINK']; ?>"><?php echo $item['TITLE']; ?></a>
        <p class="feed-description"><?php echo $item['DESCRIPTION']; ?></p>
    <?php endforeach;?>
    <p id='info'>
        This page is an example of using 
        <a href="http://www.ajaxray.com/blog/2008/05/02/php-universal-feed-parser-lightweight-php-class-for-parsing-rss-and-atom-feeds/">
            PHP Universal Feed Parser