Ning Developer Network

Making your own RSS feeds

Metadata

DifficultyBeginner
Skills RequiredPHP,XML,REST Web Services
Estimated Time Required minutes
Source Code Access RequiredNo
Categories
Verified with Versions3.1
Views1290
Average Rating 2/5 stars

Intro

Networks come with a number of built in RSS feeds.  You may run into cases where you're looking for a feed that does not exist.  Luckily, our REST API can be used to generate nearly any feed we're looking for.  Check out these pages for more info on how to use our REST API. 

One common question we get about our REST API is how to generate feeds that contain data from private network objects.  (example: feed containing the 20 most recent members)  This tutorial will show you how to make your own feed by setting up a PHP file on your network that runs a given REST request locally and returns the data for use elsewhere. 

Instructions

Before we can begin, login to your network's file system using WebDav.

  • Create a new PHP file in the root directory of your network called "newFeed.php"
  • Open this file in any text editor and enter the following code:
  • <?php
    echo XN_REST::get("REST REQUEST GOES HERE");
    ?>
  • Replace the string "REST REQUEST GOES HERE" with a request of your choice
  • Here's an example of what your file would look like if you wanted to return the 20 most recent members of your network
  • <?php
    echo XN_REST::get("http://YOURNETWORKNAME.ning.com/xn/atom/1.0/content(type='User')?from=0&to=20&order=createdDate@D");
    ?>

Open a browser window and navigate to your new file (http://YOURNETWORKNAME.ning.com/newFeed.php).  You've now created your own feed!

Created Jun 12, 2008 at 1:04pm. Last updated just now.

Documentation & Tips

© 2008   Created by Ning Developer Admin

Badges  |  Report an Issue  |  Privacy  |  Terms of Service