RSS
メインメニュー
TOP相互リンク
Counter: 281, today: 1, yesterday: 0

RSS FeedをJavascriptでサイトに表示するためのツールをFeed2JSよりダウンロード
英語サイト:後日書き直します。

Using RSS Feeds in your web pages is just a cut 'n paste away!

Get the Code To Run on Your Own Server
This information is for web site owners that would like to incorporate our Feed2JS technology on their own site- perhaps to customize it, or just to speed up the access if they feel like a local copy is better. Below you can download the necessary script files.

We provide this script as open-source under a GNU General Public License.

To run these scripts, you need a web server capable of running PHP which is rather widely available (and free). You will need to FTP files to your server, perhaps change permissions, and make some basic edits to configure it for your system. I give you the code, getting it to work is on your shoulders. I will try to help, but cannot always promise answers.

We give you this code we developed for free. If you make some use of it, please pay back by sharing a URL that uses this code.

Installation
Download Feed2JS... available as a 44k ZIP archive. The files provided include:
feed2js.php - the main workhorse script; see below for configuration details.
feed2js_config.php - local configuration, set the file paths for Magpie, etc. Accessing this as a separate include will make future updates less tedious (a simple replacement of the feed2js.php file)
nosource.php - a simple error file if the script is not provided an URL for the RSS feed.
build.php - a version of our build page which will allow your web site users to easily generate their proper JavaScript that works from your installation of Feed2JS.
style.php - a version of our style tool which will allow your web site users to select and modify CSS styles for their feeds.
style_preview.php - generates the styled previews
styles - sample style sheets used for the preview feature of the build script.
You should next download and install the Magpie RSS library (which is not included in our downloads- get the most current from the source). Take some time to consider how you will be using Feed2JS- for most uses you can put the Magpie and Feed2JS files in the same directory, but there is no reason why you could not place Magpie in a centralized directory on your site. For example, you might put Feed2JS in a web server root directory named "feed" and place the magpie files it's own sub directory:
(main server directory)

/feed
feed2js.php
... (the other associated files, see below)
/magpie
/extlib
Snoopy.class.inc
rss_cache.inc
rss_fetch.inc
rss_parse.inc
rss_utils.inc
The "extlib" directory contains the magpie required "Snoopy.class.inc". Feed2JS does not use the "smarty" files provided with Magpie.
Create a new directory to store the cache files created and used by Magpie. The easiest location is within the same place you put the Magpie files, but it can be anywhere on your server, as long as you know the file path. Make sure you change the permissions on this directory to 0777. About 90% of the set up problems are due to not creating this directory or having its permission set to be writable.
Edit rss_fetch.inc to define the file paths in the first section, including default values for DIR_SEP and MAGPIE_DIR. You will need to know the full file path on the server to the Magpie directory created in step 2. For many unix servers this path is /var/www/html but your server may have a different structure.

This is not strictly needed as all of the values are declared in the feed2js_config.php file but is good to do if you use Magpie elsewhere on your site.

The sections to edit in rss_fetch.inc should look like:

if (!defined('DIR_SEP')) {
define('DIR_SEP', '/');
}

if (!defined('MAGPIE_DIR')) {
define('MAGPIE_DIR', '/var/www/html/feed/magpie' . DIR_SEP);
}

require_once( MAGPIE_DIR . 'rss_parse.inc' );
require_once( MAGPIE_DIR . 'rss_cache.inc' );

define('MAGPIE_EXTLIB', MAGPIE_DIR . 'extlib' . DIR_SEP);
require_once( MAGPIE_EXTLIB . 'Snoopy.class.inc');
That should be all the configuration you will need.
Before going further, you may want to run the magpie test file, magpie_debug.php. If you load this file in the /feed directory created in step 2, you can edit this for your environment:

define('MAGPIE_DIR', '/var/www/html/feed/magpie/');
require_once(MAGPIE_DIR.'rss_fetch.inc');

define('MAGPIE_CACHE_DIR', MAGPIE_DIR .'cache/');

define('MAGPIE_DEBUG', 2);

define('MAGPIE_CACHE_AGE', 2);

$url = "http://jade.mcli.dist.maricopa.edu/a­lan/index.rdf";
Loading this in a web browser, e.g. http://www.mydomain.org/feed/magpie_­debug.php will test your magpie installation
If Magpie works good, you are ready to configure the feed2js_config.php file. Look for the section labeled "INCLUDES" where you must define the correct paths for the Magpie files, the cache directory, and the time setting for having cache files expire, in seconds. the default is 60*60 or one hour.

define('MAGPIE_DIR', '/var/www/html/feed/magpie/');

require_once(MAGPIE_DIR.'rss_fetch.inc');
require_once(MAGPIE_DIR.'rss_utils.inc');

define('MAGPIE_DEBUG', 0);

define('MAGPIE_CACHE_DIR', $MAGPIE_DIR . 'cache/')

define('MAGPIE_CACHE_AGE', 60*60);
Run a known RSS Feed through your installed version of the build.php page and then test the style editor page.
If you are unable to see a feed previewed from the build page, there is likely a syntax error in feed2js.php- there is now a link below where the preview should appear that allows you to call the script. If there are PHP errors, this test link will display them.
That is all!

The Simplest Installed Directory Structure
Use this outline as a map of the simplest installation, putting all files and Magpie in the same directory. You can create your own intro page (index.php, index.html) and link to the build and style pages accordingly.

/feed (directory)
build.php (feed building tool)
feed2js.php
feed2js_config.php
footer (include file for build.php, style.php
/magpie (directory)
/cache (directory)
/ext_lib (directory)
Snoopy.class.inc
rss_cache.inc
rss_fetch.inc
rss_parse.inc
rss_utils.inc
nosource.php (error page if no RSS provided)
style.php (output style tool)
style_preview.php (style preview and editor)
/style (directory) (collection of CSS styles)

投稿者: E-sitenet 日時: 2005年08月12日 14:30 | パーマリンク

トラックバック [ トラックバック(0) ]
トラックバック URL: http://www.hanzoh.net/modules/pukiwiki/tb/26

 
ログイン
ユーザ名:

パスワード:


パスワード紛失
新規登録
検索
オンライン状況
3 人のユーザが現在オンラインです。 (2 人のユーザが Yomi-search改造集 を参照しています。)

登録ユーザ: 0
ゲスト: 3

もっと...
Yomi静的PHP版