add_channel

(ReachRSS >= 0.91)
add_channel -- Adds a new channel to ReachRSS (subscribes ReachRSS to a new RSS/RDF feed)

Description

boolean add_channel ( string channel_url )

This function adds the specified channel to ReachRSS. The new channel will then be monitored just as any other (once added you need not re-add it or manage it in any special way). Adding a channel is the same as "subscribing to an RSS feed" (many RSS readers use this terminology). The specified channel_url must be a valid RSS or RDF feed and must be retrievable by ReachRSS. add_channel() automatically calls save_data() upon successful addition of the channel.

add_channel() returns true on success, false on failure (eg: the server could not be contacted, the file was not found, the RSS feed is not valid, or there was a problem saving the data file). If the problem was a connection or HTTP error, an error message will be output. If the specified channel already exists, add_channel() will return true without actually adding it again.

Example 1. add_channel() example

$ReachRSS = new ReachRSS();
$ReachRSS->Startup();
$ReachRSS->add_channel("http://www.comicalert.com/public/popular24.xml");

This example will subscribe ReachRSS to the "most popular comics" feed at Comic Alert!

See also remove_channel(), channel_exists(), channels()

Back to Function List

 

Home | Features | Samples | Demo | Download | Register | Help / Support