The code found on this page may auto-wrap, causing the code to flow to the next line. Please keep this in mind when copy/pasting code from this page.
Fancy having the fastest Guild Wars news around on your website? Or even your desktop? Then you've come to the right place :) Here you'll find a selection of links and tips on using GW Stratics's RSS-based newsfeed with JavaScript, PHP, Perl or even with Trillian and other systems.
JavaScript
The simplest and easiest way to put the newsfeed is to use JavaScript. You have two options: a pre-formatted feed (as seen above) and an unformatted feed that will allow you to format to match your sites design (you'll need to use CSS - see the CSS section below for details).
To use the pre-formatted feed, simply include the following HTML snippet on your page where you want the feed to appear:
<script language="JavaScript" src="http://gw.stratics.com/php-bin/rss/jsformat.php">
<noscript><a href="http://gw.stratics.com/">Latest GW News</a></noscript>
</script>
And to use the un-formatted feed, include the following HTML snippet on your page where you want the feed to appear, then set up the CSS on your page to make it look nice:
<script language="JavaScript" src="http://gw.stratics.com/php-bin/rss/javascript.php">
<noscript><a href="http://gw.stratics.com/">Latest GW News</a></noscript>
</script>
PHP
If you don't want to use JavaScript, you can also grab the newsfeed using PHP (or Perl/SSI). The PHP include command can, if your install of PHP allows it, be used to read the feed. Simply add the line:
<?php include("http://gw.stratics.com/php-bin/rss/format.php"); ?>
into your page (or call http://gw.stratics.com/php-bin/rss/read.php if you want the un-formatted feed).
Perl
If you want to use Perl instead, you can get the same effect using a small script and the LWP module (which is usually installed on most systems these days). Add this script to your /cgi-bin/ as, for example, simpleread.pl:
#!/usr/bin/perl
use LWP::Simple;
print "Content-type: text/html\n\n";
print get('http://gw.stratics.com/php-bin/rss/format.php');
You may need to change the first line to point to your copy of Perl and, again, you can use http://gw.stratics.com/php-bin/rss/read.php to get the unformatted version. With that in place, add the following SSI command to your page to read the feed:
<!--#include virtual="/cgi-bin/simpleread.pl"-->
CSS
The feed supplied has a number of CSS classes set up. You can set these in your own page to control the look of the feed if you want. The classes are as follows:
- s_main
- s_head
- s_hlink
- s_list
- s_item
- s_ilink
And you can see what they affect in this example:
<table class="s_main">
<tr><td class="s_head><a href="http://gw.stratics.com" class="s_hlink" target="_blank">Guild Wars Stratics</a></td></tr>
<tr><td><table class="s_list">
<tr><td class="s_item"><a href="http://gw.stratics.com/index.php#newsitem1093454769,9082,," class="s_ilink" target="_blank">Wish House of Commons #4 </a></td></tr>
<tr><td class="ss_item"><a href="http://gw.stratics.com/index.php#newsitem1093309136,33874," class="s_ilink" target="_blank">Stratics will be hosting Fansite Friday #12!</a></td></tr>
<tr><td class="s_item"><a href="http://gw.stratics.com/index.php#newsitem1093197968,79221," class="s_ilink" target="_blank">Stratics will be hosting Fansite Friday #12!</a></td></tr>
<tr><td class="s_item"><a href"http://gw.stratics.com/index.php#newsitem1093053706,98233," class="s_ilink" target="_blank">Fansite Friday #11</a></td></tr>
<tr><td class="s_item"><a href="http://gw.stratics.com/index.php#newsitem1093028992,23958," class="s_ilink" target="_blank">Fansite Program News</a></td></tr>
</table></td></tr></table> Other Stuff
If you want to access the raw RSS 1.0 data, you can reach it at http://gw.stratics.com/php-bin/rss/raw.php. Several programs can be set up to read and parse this, including WatzNew for which we have already created a channel you can install. Some older systems, like the RSSNews plugin for Trillian Pro will need the earlier RSS 0.9 format, which can be reached at http://gw.stratics.com/php-bin/rss/091.php.
Comments, bugs and suggestions can be directed to GWAdmin.
|