Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A collection of examples for generating a Yahoo! Application Platform application from an RSS feed
PHP
Tree: 4c93ca65f0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
templates
index.php
license.markdown
readme.markdown
readme.pdf

readme.markdown

Yahoo! Application Platform (YAP) RSS application generator

A simple framework for generating a Yahoo! Application Platform application from an RSS feed

Preamble

This document is intended to address two typical use cases:

  1. "Porting" an app based on a Yahoo! Front Door XSL-based template
  2. Creating a new YAP app based on a standard RSS feed

Installation and usage instructions follow, but in brief, this framework operates by consuming a given feed, parsing the feed data using PHP's SimpleXML library, and passing the parsed data to a PHP/HTML/CSS template for rendering. In an app's description, the location of the framework is given as the base URL for the app, and the output from the template is returned back to YAP for display.

Installation

  1. Obtain the source code:
    • Click the download button on the Github project page (github.com/ydn/rss_yap_app), pick a compression, and save the file.
      OR
    • Clone this repository: git clone git://github.com/ydn/rss_yap_app.git
  2. Upload the project to a server accessible by YAP

Usage

Requirements

  • PHP 5.2 with SimpleXML

Initialization

  1. Create a new YAP application
  2. Set the Application URL of the app to point to the location of this directory on your server
  3. Set the Small View Default Content to:

    <style>
    #loading {
       font-size: 12px;
       font-family: Verdana, Arial, Helvetica, sans-serif;
       margin: 10px;
       background-image: url(http://l.yimg.com/a/i/ww/met/anim_loading_sm_082208.gif);
       background-repeat: no-repeat;
       padding-left: 30px;
       height: 16px;
    }
    </style>
    <yml:include replace="loading" params="index.php">
       <div id="loading">Loading ...</div>
    </yml:include>   
    
  4. Click the "Save" button

  5. Click the "Preview" button to see your app

Customization

Using a standard RSS 2.0 feed

  1. Open index.php in a text editor
  2. Set the $feedUrl variable at the top of the file to point to the feed of your choice, e.g. http://sports.yahoo.com/sow/rss.xml
  3. Save the file and reload the app
  4. Note: by default, rss_yap_app only handles RSS 2.0 syntax. Some feeds may require special handling.

Defining special handling for a feed

If you are "porting" an existing Yahoo! Front Doors template app, or if your feed uses custom xml namespaces, you may need to create a custom template to render the feed. Here are instructions for doing so:

  1. Copy templates/basic.php as another file. For this example we'll call the file special.php and save it in the templates directory.
  2. Open special.php in a text editor.
  3. Templates use standard PHP alternate syntax. Edit the styling, markup, and templating to match the structure of your feed.
  4. Edit index.php:
    • Set the feedUrl variable to point to the new feed.
    • Set the templatePath variable to point to templates/special.php.
  5. Save the file back to your server.
  6. Refresh your app to see the changes.

License

Something went wrong with that request. Please try again.