SFU Crest Simon Fraser university SFU
Home People Events Research Graduate Undergraduate
PHP icalendar Google Calendar and PHP icalendar MRBS Room booking Calendar  

Setting up Feed2JS on fraser.sfu.ca

Our feed2js was hacked (July 2014)- we had not updated it or used it and should have removed the code (it is gone now).

You don't really need to set feed2js up- you are welcome to use my installation. Just go to https://cgi.sfu.ca/~science/feed/build.php and https://cgi.sfu.ca/~science/feed/style.php (style has not been tested much). Please do tell me if you start using it. The cache refreshes once every 14 minutes (thus additions or changes you make to the RSS feed will not show up instantly).

Thanks to Steve Hannah for originally suggesting Feed2JS to me. These instructions are very basic & preliminary- questions/suggestions are welcome. You may want to look at alternative RSS feed mashups etc e.g. http://code.google.com/apis/ajaxfeeds/

In Fraser in the sec_html folder (see setup directions in MRBS Room booking Calendar), make a feed2js folder and put the files in it- you can connect to fraser via a mac by afp://home.sfu.ca. Check the Feed2JS http://feed2js.org/ for more security changes, such as stopping error warnings in feed2js_config.php and deleting magpie_debug.php magpie _simple.php.

Add the line

as the first line to all php files except two:
In build.php, feed2js.php, stylepreview.php, footnote and nosource.php, the code assumes the host server is http, while fraser cgi is https. In build.php e.g.:
		$my_dir = 'http://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']);
http needs to be changed to https to work. (The author is looking for people to help with code).

If you get an error with feeds using https (SFU events), Line 84 in the file /magpie/extlib/Snoopy.class.inc may need to be modified from var $curl_path = "/usr/bin/curl"; to var $curl_path = "/usr/local/bin/curl"; (Thanks to Graham Ballantyne & Derek Warren).

SSH to fraser and make these UNIX permission changes:

1: account_fraser% cd sec_html
3: account_fraser% chmod 711 feed
4: account_fraser% cd feed
6: account_fraser% chmod 700 *.php
7: account_fraser% chmod 711 magpie
8: account_fraser% chmod 711 style
9: account_fraser% cd style
11: account_fraser% chmod 700 *.php
12: account_fraser% chmod 644 *.jpg
14: account_fraser% chmod 644 *.gif
15: account_fraser% chmod 644 *.css
17: account_fraser% cd ..
18: account_fraser% cd magpie
19: account_fraser% chmod 0777 cache_utf8
20: account_fraser% chmod 0777 cache
22: account_fraser% chmod 711 extlib

Assuming your events are not timed to the second, in feed2js_config.php change
$date_format = "F d, Y h:i:s a"; to
$date_format = "F d, Y h:i a"; or $date_format = "d F Y h:i a"; (Thanks Duncan Napier)

Currently I get the warning

Warning: No support for iconv (--with-iconv) or multi-byte strings (--enable-mbstring). No support character set munging.
Notice: Undefined property: etag in /staff1/account_fraser/sec_html/feed/magpie/rss_fetch.inc on line 157
and/ or

Notice: Undefined index: description in /staff1/account_fraser/sec_html/feed/magpie/rss_parse.inc on line 403
But everything appears to work okay. Any suggestions (or security warnings) will be appreciated.