battletagoneCof5#1879
Showing posts with label tech. Show all posts
Showing posts with label tech. Show all posts

03 December 2012

Battle Pet Teams Widget

Just realized my widget showing the battle pet teams was incorrect. Blizzard changed the name of the id in their XML code from "battlePetId" to "battlePetGuid". I had to fix that, because without it there was no joy in Mudville.

Happy battling!

11 November 2012

Achievement feed issue

If you're using WAFB to showcase recent achievements, you won't actually see the achievements themselves.

I'm looking into this, but when I check the Blizzard site I'm getting the same error. See, I'm using the Achievement API to display the specific achievement's name, description, criteria, etc.  There seems to be an issue getting anything to return on the Achievement API (official forum post here if interested).

I'll be monitoring responses and if necessary will make any updates.  My hope is that this is purely temporary and will resolve itself!

Happy achieving!

23 October 2012

WAFB Update

Expanded Details Example
As is the case, the more you muck about with something, the more comfortable you feel.  I've updated the WAFB gadget to include localization on the US and EU servers.  If anyone is actually reading this on the Korea (KR), Taiwan (TW) or China (CN) servers, I'd love feedback if you can actually use this or not. I simply have no means of testing on those servers.

The WAFB page has been updated with the new configuration instructions.  Thanks so much for all of the feedback!

14 October 2012

Pet Battle Teams: Blogger Style

Yep. I wanted to show of my current pet team, so thanks to the data that's available from the Blizzard Community API now I can.  Enter the new gadget residing proudly in my sidebar.

For more details, check the WBPT page.

Blogging and Pet Battles.  They work well together!

14 September 2012

Blog Fiddling, Redux

I really need to stop tinkering and start writing. I've spent more time on the web-coding and layout for this than I have actually writing content.

However, at this point at least, I'm finally happy with the look.  Who knows how it will sit with me, but I wanted to get to a lighter background and replace that worgen at the top.

Have a great weekend!

11 September 2012

Blog Fiddling

Hello maintenance day...

Since I'm not going to be logging into the game anytime soon, I spent some time fiddling with the Blog itself.

Character Roster (Alter-Egos Page)

As a side-effect of the Achievement Feed, I've been messing around with displaying my character information on the blog as retrieved from BattleNet.  I like the idea of showing a 'current' view -- at least as current as the last time I logged out on that character. (Note to self, add a timestamp).
Check out the page - it currently shows the equipped items and talents / glyphs.  It's a work in progress, but it's definitely an enjoyable work.

New Comment System (DISQUS)

I wanted to add a bit more interactivity to the comments. I adore those of you leaving comments -- it's such a concrete reinforcement that people are not only reading the drivel I'm writing, but in some fashion that drivel impacts them enough to actually reply to me!  I'm reminded of school crushes: I'd "like" somebody and then I'd be flabbergasted when they actually responded to me. It was giddy then, and it's giddy now.
I wanted to highlight that a bit and give it some pizazz; if there are any issues, please hit me up via Twitter (since if there are issues you won't be able to comment, will ya?)

30 August 2012

Finalized Achievement Feed for Blogger

Well... the brains at Google are reviewing my work to ensure it's acceptable, but I've submitted the achievement feed you can see off to the right over to Blogger for actual inclusion in the Blogger Gadgets.

In the meantime (or assuming it's rejected for some reason), you may add this by performing the following steps.

  1. Copy this source code (hosted on googlecode.com as wow-blogger-achv):
    http://wow-blogger-achv.googlecode.com/git/wow-achievement-feed-for-blogger.xml
  2. Open up your Blogger blog in Layout mode, and click Add Gadget in the section you want the achievement feed to display.
  3. Click "Add your own" and paste in the source above.
  4. Paste in URL

  5. Enter the configuration parameters.
  6. Enter your choices
    1. The Character information (region, server, character name)
    2. The formatting information (to keep styling consistent with your view).  The default styling is populated, but these are CSS style entries (Hex Colors, font-family, etc).
    3. If you do not want to show the full character name, un-check the Show Character option.
    4. If you do not want to show icons in the list, choose the 0px icon size.
If you experience any issues, hit me up here or on Twitter!

Thanks!

27 August 2012

Achivement Feed Gadget

I'm looking for some volunteers...

I have written an achievement feed in Google for use within the Blogger platform, and it works for me, but I'd love some feedback from others before posting it all official-like.

If you care to help out...

First, /hug. You are awesomer than awesome.

Second, please edit your blogger design and add a gadget to any sidebar / section area. So far, with me?   This is just like adding a regular gadget.

Here's where its different: Click the "Add Your Own" option.  I promise, there is no malicious code here. Nothing's gonna break your blog!

Copy this hosted XML (Go go google gadgets!):

http://hosting.gmodules.com/ig/gadgets/file/104245060944445812083/wow-achievement-feed-google-gadget.xml 

Paste that into the box and click Add By URL.

There are fields you need to complete -- character name, geographic realm (I've only tried with US, so any EU players feedback would be simply fantastic) as well as some formatting so that it looks consistent with your overall theme.

Any issues?  Let me have 'em in the comments.

You guys rock!

08 August 2012

Occupying my Time before Mists with Blog Tinkering

Lately, I have been neglecting my characters. I think I've been able to get online and actually play for about an hour since Friday what with vacations, work and the rest. That's not to say I haven't had any free time; I have. However, I've not spent that free time in the game world but rather in the Matrix behind the game.... Yeah, minus 50 DKP for mixing in a Keanu Reeves movie reference, despite the fact that it's one of my favorite films.

 Anyways... What have I been doing? Tinkering with the blog! I have added a characters page to the navigation bar. It's still undergoing some additional tweaks, but I've gotten myself indoctrinated in the language of the Armory and now I'm feeling comfortable in pulling character data to display on my own little corner of the world. If you check it out, I'd love feedback on what works and doesn't work (the whole detail section is to be coded). In designing something like this, I asked myself what do I care about when I hit Blizzard's Armory or Wowhead? And from that, I get current equipped items, current title, total achievement points, recent achievements, PVP stats and reputations. Cool! But, you can also retrieve all of you hunter pets. Oh that's sharp. And each companion and mount. Ummm... schwing! Progression? Cool!

So now I have entirely too many things I want to do out of game and in game before the expansion drops!

In game, my list is really only two things (though one is a two-parter):

  • I want to ding my mage and my rogue to 85. That will leave me with only a warrior and the eventual monk on my server. 
  • Apparently, I also need to make friends with a wealthy goblin because I have just learned about the Grand Expedition Yak (an upgrade to the Traveler's Tundra Mammoth or Repair Cow as I call it). Last I heard, this sucker was gonna be a 60,000 gold sink! Definitely need to multiply my gold base. Maybe I could place it all on a roulette wheel.... Yeah, if WoW had a casino, I'd never log off. In reading AH blogs, a few folks have pondered stocking up on bags.  With all the questing I'm doing in Outlands, Northrend and Cata zones, I should have plenty of cloth... perhaps it will work! 
 Hope your week's are treating you well!

02 August 2012

Your Very Own Blogger Achievement Feed

I've been struggling with Blogger to display a feed of recent achievements for my main character. There is a gadget available that other WoW Bloggers are successfully using, but no matter what I tried it just wasn't working for me.

Maybe I could make one up? Some Google searches led me to Blizzard's Website and Mobile Feedback forums. There are some great examples of tricks which are mostly PHP solutions to retrieve from the Blizzard APIs.  However, without my own server, PHP is not an option. I needed a JavaScript option to stick into a HTML / JavaScript Gadget. A post by Brawrz outlined a method for realms. Now we're cookin'!

After some trial and error, I'm happy to have an achievement feed over on the sidebar for my main character, a Worgen Hunter.

The Achievement Feed Source
Should you wish to recreate this for your own Blogger site, here's what I did.

Update the Template

First and foremost, we need to add an external script to the template. In Design mode, select the Template option. Then, Edit HTML. You'll be cautioned against this route, but go ahead and proceed!
Search for the ending of the <head> element in your template.  Just before that </head> element, insert these lines:
  1. <!-- JQuery Script -->
  2. <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>

Create the Gadget

Back in Design mode, now we need to go to the Layout option and add a new gadget: HTML/JavaScript. Give this a title and then in the Content section, place the following code (replacing your realm and character name in lines 7 and 8):
  1. <div id="charProfile"></div>
  2. <script type="text/javascript">
  3. var intMax = 10; // define maximum number of achievements to display
  4. // assemble the JSON URL
  5. var bnetRegion = "us";
  6. var bnetUrl = "http://" + bnetRegion + ".battle.net";
  7. var bnetRealm = "REALM_NAME"; // borean-tundra or velen for example
  8. var bnetChar = "CHARACTER_NAME";
  9. var url = bnetUrl + "/api/wow/character/" + bnetRealm + "/" + bnetChar + "?fields=feed&jsonp=?";
  10. $.getJSON( url, function( data ) {
  11. // format the base character profile data
  12. var strCharProfile = "<div><h4>Total Points: " + data.achievementPoints + "</h4></div>";
  13. // write the string to the div
  14. $(strCharProfile).appendTo("#charProfile");
  15. // initialize counter at zero
  16. var intCount = 0;
  17. // loop through each feed entry in the JSON source
  18. $.each(data.feed,function(f,feed){
  19. // only output the feed entries that match the ACHIEVEMENT type and
  20. // ignore the loot drops and boss kill entries.
  21. if (feed.type=='ACHIEVEMENT') {
  22. if (intCount < intMax) { // this is an achievement, so ensure we haven't exceeded our max
  23. // assemble the icon image source url
  24. var blizzIcon = "http://us.media.blizzard.com/wow/icons/18/" + feed.achievement.icon + ".jpg";
  25. // assemble the wowhead.com tooltip lookup
  26. var wowheadUrl = "http://www.wowhead.com/achievement=" + feed.achievement.id;
  27. // format the achievement entry string - icon and link
  28. var strFeed = "<div class=\"charProfile\">" + "<img src=" + blizzIcon + "></img>" + " " + "<a href=" + wowheadUrl + ">" + feed.achievement.title + "</a></div>";
  29. // write the achievement entry to the div
  30. $(strFeed).appendTo("#charProfile");
  31. intCount++; // update our good count
  32. }
  33. else { // we hit more than counter so terminate the .each loop
  34. return false;
  35. } // end counter if
  36. } // end ACHIEVEMENT match if
  37. }); // end $.each
  38. }); // end $getJSON
  39. </script>

Define the Output

First, we define a container in our gadget to contain text. Line 1 creates a <div> and assigns a unique ID to that <div> called "charProfile".  Later, after we've created a string of text and formatted that string with HTML markup, we add that string to the existing <div> with the ID of "charProfile in Line 14.
By the same token, we format another string with the actual achievement feed data and add that string to the existing <div> in line 30.

Get the Data

Next, we're lookup up a character's profile using the Blizzard Community Platform API. Years back, you used to be able to retrive character data from an XML / RSS feed.  No longer! It's all good, though. The forums have some great examples on how to use JQuery to grab the JSON data from the API.

In this case, I wanted the summary of total achievement points and the ten most recent achievements completed.  So let's get cracking.

The URL for my character and region is created in lines 5 to 8, and then line 9 retrieves that data from BattleNet and saves it in an object named 'data'. Great, we have data! Uh, we've got a lot of data. Let's pick out what we want.

Rinse and Repeat

Line 18 starts looping over the results; specifically the 'feed' entries in the results.  For each 'feed' entry contained within the source 'data', we have a function that does something with that selected feed (and it's children). This is where you get the achievement's ID, icon reference, timestamp and other bits.

Validate Selection

However, the 'feed' contains a combination of achievements, boss kills and loot drops. We don't want all that, so how do we skip the unwanted result entries? I'm sure there are more elegant ways, but we're going with the if ... else construct. Line 21 checks if the current 'feed' entry selected above in line 18 is for an achievement. It it is, let's handle it. If not, don't do anything and loop back up to select the next 'feed' element.

But wait, there's more! Not only do we only want achievements, but we only want up to a maximum of ten to show. Otherwise, the entire side bar is achievements!  Line 22 checks that we have not already selected more than our maximum value.  If we are over our max, we don't continue looping through each remaining 'feed'. Nope! Line 34 terminates the loop as soon as we've successfully read our maximum entries.

Display the Goodies

For the output, a sub-heading is written to the gadget first, and then we'll write each selected achievement read during the each loop. Furthermore, with the graciousness of Wowhead's tooltip script, we can link the achievements in a nice pretty tooltip. We're borrowing Blizzard's media by using the reference to the icon within. That's the function of lines 23 - 30.

All in all, I'm happy to have an achievement feed in Blogger. I'm sure that there are more refined ways of accomplishing this, and I may give an actual Google Gadget a go, but for the moment I'm happy.
Thanks for stopping by!