Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A collection of examples for generating a Yahoo! Application Platform application from an RSS feed
branch: master

This branch is even with ydn:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
basic.php
entertainment.php
license.markdown
readme.markdown
readme.pdf
standard.php

readme.markdown

RSS-based applications for the Yahoo! Application Platform (YAP)

Preamble

rss_yap_app is a collection of examples for generating a Yahoo! Application Platform application from an RSS feed. This document is intended to describe usage of this project for two common scenarios:

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

rss_yap_app 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 template to use is given as the base URL for the app, and the output from the template is returned back to YAP for display. Detailed installation and usage instructions are given below.

Prerequisites

  • PHP 5.2 with the following enabled:
  • A server that can serve content to YAP, i.e., a server accessible via a valid url and capable of receiving POST requests.

Steps for creating an RSS-based application for YAP

  1. Obtain a local copy of this project:
    • Click the download button on the Github project page, 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 your server
  3. Create a new YAP application using the YDN dashboard
  4. Set the Application URL of the app to point to the location of the {template}.php file in the project directory on your server, e.g. http://example.com/rss\_yap\_app/standard.php
  5. Set the Small View Default Content to:

    <style>
    #loading {
       font-size: 12px;
       font-family: Verdana, Arial, Helvetica, sans-serif;
       margin: 10px;
    
       /* the standard yap loading animation */
       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>
    
    <!-- replace the element 'loading' w/ the content returned from the yml:include call -->
    <yml:include replace="loading">
       <div id="loading">Loading ...</div>
    </yml:include>   
    
  6. Click the Preview button to see your app

Customization

Using a standard RSS 2.0 feed

  1. Open standard.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: As is, standard.php 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.
  2. Open special.php in a text editor.
  3. Note: templates use PHP's alternate syntax. Edit the preprocessing, styling, and markup to match the structure of your feed.
  4. Save the file back to your server.
  5. Edit your app in the YDN dashboard and set the base to {your domain}/{path to rss_yap_app}/special.php
  6. Refresh your app to see the changes.

License

Something went wrong with that request. Please try again.