Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: feeds/feeds.php

class Feeds - Get news

This data abstraction for feeds provides two main functions, plus several utility functions:

This script is a reference file of this system.

Licence: GNU Lesser General Public License

Auteurs:

Testeurs:

decode_date() - Decode a date

function decode_date($date)



Voir aussi:

get_local_news() - Get current news from this server

function get_local_news($count=20, $variant='feeds')

Actually, this function lists most recent published articles.

get_remote_news() - Get news from remote servers

function get_remote_news($count=20, $variant='compact')

This function extracts from the database most recent links fetched from feeders.

By default, up to 20 items are displayed.

Voir aussi:

get_remote_news_from() - Get news from a remote server

function get_remote_news_from($feed_url)

This function is aiming to run silently, therefore errors are logged in a file. To troubleshoot feeders you can configure the debugging facility in the configuration panel for feeds (parameter debug_feeds, at feeds/configure.php).

Voir aussi:

tick_hook() - Get news from remote servers

function tick_hook($forced=FALSE)

This function queries remote sources and populate the table of links based on fetched news.

On tick, the including hook calls Feeds::tick_hook(). See control/scan.php for a more complete description of hooks.

The function browses the database to locate servers acting as feeders, and read the URLs to use.

A round-robin algorithm is implemented, meaning that servers are polled in sequence throughout successive ticks. At most 1 feed is parsed on each tick, to limit impact when the "poor-man" cron mechanism is used, which is the default setting.

XML feeds are fetched and parsed according to their type. At the moment YACS is able to process RSS and slashdot feeds. Link records are created or updated in the database saving as much of possible of provided data. Item data is reflected in Link, Title, and Description fields. Channel data is used to populate the Source field. Stamping information is based on feeding date, and channel title. Also, the edit action 'link:feed' marks links that are collected from feeders. The anchor field is set to the category assigned in the server profile.

At the end of the feeding process, the database is purged from oldest links according to the limit defined in feeds/parameters.include.php, set through feeds/configure.php. See Links::purge_old_news().

Voir aussi:

Tools
Browse the source of this script
Server software