Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
angeljibrille (New Admin) 1/20/2011 9:05 PM EST : XML/XSL for Axho's WoW Feeds
angeljibrille
Posts: 258
Fingers of Fury!

So, I am by no means an expert at XML/XSL. In fact, because it took me two freaking days to figure out how to do this, I thought I would share my technique with others.

We have a GuildPortal site:
http://impulse.totalgamehost.com

I wanted to be able to have the Activity List show on our homepage.  You need to be able to access the Guild Control Panel to do this. I am pretty sure you have to have a PAID account as well.

1. Go to http://wowfeeds.wipeitau.com/  and generate your Guild Activity Feed as XML (not JSON or HTML).
  -- you end up with a link like this:
 http://wowfeeds.wipeitau.com/GuildActivity.php?location=US&rn=Kilrogg&gn=Impulse&output=XML&callback=?

2. Here's a sample XSL file to "translate" your XML document:
*PLEASE NOTE* I am not an XML person, this code could very well suck rocks. However, it does WORK. That's all I really cared about.


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:variable name="lower">
   abcdefghijklmnopqrstuvwxyz
 </xsl:variable>
 <xsl:variable name="upper">
   ABCDEFGHIJKLMNOPQRSTUVWXYZ
 </xsl:variable>
<xsl:template match="/">
<center><h1>GUILD LEVEL: <xsl:apply-templates select="GUILDACTIVITY/GUILDLEVEL" /></h1></center>
    <table border="0" cellpadding="5">
      <xsl:for-each select="GUILDACTIVITY/ACTIVITYLIST/ACTIVITYITEM">
      <tr>
        <td><a href="http://us.battle.net/wow/en/character/kilrogg/{NAME}/simple" target="_blank"><xsl:value-of select="NAME"/></a></td>
        <td><a href="http://www.wowhead.com/{translate(TYPE,$upper,$lower)}={NUMID}" target="_blank"><IMG SRC="{ACHIMAGE}" align="middle" border="0"/></a></td>
        <td><a href="http://www.wowhead.com/{translate(TYPE,$upper,$lower)}={NUMID}" target="_blank"><xsl:value-of select="ACHOBJECTIVE"/></a></td>
                <td><xsl:value-of select="TYPE"/></td>
        <td><xsl:value-of select="ACHTIME"/></td>
      </tr>
      </xsl:for-each>
    </table>
   <center><small><p><a href="http://wowfeeds.wipeitau.com/">Axho WoW Feeds</a></p></small></center>
</xsl:template>
</xsl:stylesheet>

* Save the above text as a file called yourguild.xsl . My file is called "impulse.xsl".

Explanation of the above:
This will show your Guild Level, the Name of the person with the Achivement (linked to his/her BattleNet Profile), an Image for the Achievement (linked to the Achievement on WowHead), Text for the Achievement (linked to the Achievemnt on WowHead), the type of the achievement, and the time of the achivement. It also gives a courtesy link to Axho's WoW Feeds.

3. Go to Guild Portal, click on your Control Panel.
 - Click on "General Settings & Tools"
 - Click on File Manager
 - Upload yourguild.xsl
 - Click on "Get URL" once it's uploaded, and save that link for later.

4. In your Control Panel, click on "Pages & Content (Widgets)".
 - Find which page you want to put your new Feed on. I put mine on "HOME".
 - Click on that page section, then click on "Add Widget".
 - You'll see a list with a little search box. Type "XML" into the search box and press enter/return.
 - You'll see a Widget called XML/XSL Transformation. You want to "Add to site".

5. Now you want to change the settings for your new Widget.
 - on the first tab, XML Source, check "Remote File" and the XML File URL is the link from your Axho's Wow Feeds page.
 - My link, for example, is:
 http://wowfeeds.wipeitau.com/GuildActivity.php?location=US&rn=Kilrogg&gn=Impulse&output=XML&callback=?
 - Click on the second tab, XSL Source, check "Remote File" and you want to paste in your URL you generated in Step 3.
  - My link looks like:  http://www.axiomfiles.com/Files/123456/impulse.xsl
 - Click "Test Transform" to make sure there are not any errors.
 - Save Changes

*PLEASE NOTE* (Since I learned this the hard way). The "paste" box for the XSL does NOT work. You cannot just paste your code in, you have to link to a remote file. It's an old bug apparently from reading the GuildPortal forums. You need to do Step 3 and upload the file or you are going to be banging your head against this for hours.

6. Position your new widget where you want it.

7. Profit!

I hope this helps people.

~Jib

TopBottom

Mottie (MVP) 1/21/2011 12:40 PM EST : RE: XML/XSL for Axho's WoW Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi Angeljibrille!

Nice find! I was wondering when and if we'd ever get a feed from battlenet... I hope this site lasts!

Anyway, I modified your XSL and made it more generic. And I fixed the item wowhead links. And since it's been made generic, people can just link to my copy instead of uploading their own. So the instructions are now:
  1. Get your Guild Activity Feed XML link from http://wowfeeds.wipeitau.com/
  2. Add an "XML/XSL Transformation" type widget
  3. When you edit it, add the URL you get from step 1 into the "XML Source" tab (Remote File selected).
  4. Add this url "http://www.axiomfiles.com/Files/258012/wow-activity.xsl" in your "XSL Source" tab (Remote File selected).
  5. Click [ Test Transform ] to make sure it works.
  6. If it does, click [ Save Changes ]
  7. If it doesn't work, make sure the feed url you got in step 1 is correct, or message me with the link so I can test it
If you are interested in the modified XSL, just click on the link in step 4 to see it 

TopBottom

angeljibrille (New Admin) 1/21/2011 1:13 PM EST : RE: XML/XSL for Axho's WoW Feeds
angeljibrille
Posts: 258
Fingers of Fury!

Yeah, I adjusted my code above today when I realized the links were not working  But it's fixed now on my explanation as well.

Thanks for your contribution as well!
TopBottom

Mottie (MVP) 1/21/2011 1:44 PM EST : RE: XML/XSL for Axho's WoW Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi Angeljibrille!

I stink at XSL.. I had no clue you could put the translate inside the curly brackets... saves a lot of extra junk!

Anyway, would you mind if I added this information to my help site?... I'm trying to keep everything indexed and easy to find
TopBottom

angeljibrille (New Admin) 1/21/2011 1:46 PM EST : RE: XML/XSL for Axho's WoW Feeds
angeljibrille
Posts: 258
Fingers of Fury!

Lol, sure! If you could give me credit since this was such an enormous pain, I'd appreciate it!

I'll have to check out your page.
TopBottom

Axho (New Admin) 1/24/2011 5:46 PM EST : RE: XML/XSL for Axho's WoW Feeds

Axho
Posts: 2
Getting Started!

Hi,

I'm Axho, creator of the wowfeeds.wipeitau.com

Just wanted to come and post and say this is a very nice tutorial. May I ask if I can use your tutorial and place it on wowfeeds.wipeitau.com ?

I've been going around gathering tutorials to put on the feed site to save people searching

Kind Regards,

Axho

www.wipeitau.com
wowfeeds.wipeitau.com
TopBottom

Mottie (MVP) 1/24/2011 6:50 PM EST : RE: XML/XSL for Axho's WoW Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hi Axho!!

Thank you for the great service! You are more than welcome to use any of the information I posted both here and from my Help site, but I can't speak for Angeljibrille.

Also, I've actually added some css classes and examples in the post over on my help site to provide more styling options.
TopBottom

Axho (New Admin) 1/24/2011 7:17 PM EST : RE: XML/XSL for Axho's WoW Feeds

Axho
Posts: 2
Getting Started!

Very nice tutorial implementing the CSS on the HTML feed!

To make it easier for me, I will most likely link to these other feeds and tutorials that I have found instead of putting them on my site directly.

I plan to include a bunch more feeds as soon as I get a chance. such as a progression feed. you simply nominate a character from your guild who's been on every run (most cases the GM) along with your guild name and realm name, and it'll pull your guild progression with dates / times, bosses, instances etc.

Also a profession list, a reputation list, an item level list of guild members, and a list of activity feeds per character.

The character activity feeds contains a few more details then what is displayed on the main guild news activity feed. But the cool part is, when I have the character activity feed complete, you can say display the guild activity feed or guild roster. Then using some funky java mouse over or click-able toggle on the player name, you can return / display the individual character activity feed using the second feed dynamically.

Regards,

Axho
TopBottom

Mottie (MVP) 1/25/2011 12:09 AM EST : RE: XML/XSL for Axho's WoW Feeds
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Hey Axho!

I was going to ask, do you think it's a good idea linking to the battle.net race and class icons? I know there have been problems in the past with sites getting blocked for using too much bandwidth. So maybe change the images to wowhead? or just include the name (which can then be used as a class name) and let the user point to their own images.
TopBottom

Nasamun (New Admin) 1/25/2011 2:22 PM EST : RE: XML/XSL for Axho's WoW Feeds

Nasamun
Posts: 95
Posts With Wolves

I'm having issues getting it to work for my guild site. Could it be from having non-standard character in my guild name?

http://wowfeeds.wipeitau.com/GuildActivity.php?location=US&rn=Echo%20Isles&gn=Sanctuáry&output=XML&callback=?

http://www.guildportal.com/Guild.aspx?GuildID=332558&TabID=2783278


Thanks for the help in advance.

Shawn
TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%