-
Notifications
You must be signed in to change notification settings - Fork 7
/
rss.php
32 lines (30 loc) · 985 Bytes
/
rss.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/* initialize database and libraries */
define(RSS_AGE_MINUTES,60);
define(RSS_NUMBER_STORIES,15);
/* initialize the SMT Facebook appliation class */
require_once PATH_FACEBOOK."/classes/app.class.php";
$app=new app(NULL,true);
require_once PATH_FACEBOOK."/classes/pages.class.php";
$page=new pages($app->db);
require_once (PATH_PHP.'classes/common.class.php');
$common=new common($app->db);
/* process request variables */
if (isset($_GET['action']))
$action=$_GET['action'];
else
$action='TopStories';
/* begin building the page */
$cacheName=CACHE_PREFIX.'Rss'.'_FB_'.$action;
if ($common->checkCache($cacheName,RSS_AGE_MINUTES)) {
// still current, get from cache (fast)
$code=$common->fetchCache($cacheName);
} else {
// recreate the page (slow)
require_once(PATH_CORE.'/classes/rss.class.php');
$rssObj=new rss($app->db,URL_CANVAS);
$code=$rssObj->build($action);
$common->cacheContent($cacheName,$code);
}
echo $code;
?>