360Voice Bits Plugin

About

360Voice Bits is a simple plugin I wrote one day to utilize the 360Voice API. 360Voice.com is a site where you can register your XBox360 gamertag and the site will generate little blurbs based on your XBox360 use. Currently, it only retrieves the most current entry and displays that in a simple block of text on your site.

Download

  • 360Voice Bits v1.3 - XML Parser rewrite to make it PHP4 & PHP5 compatible (June 29th, 2006)

Installation

Note: Since this plugin reads from the 360Voice site, you must have allow_url_fopen = On in your php.ini file.

1. Place 360voicebits.php in your wordpress/wp-content/plugins folder

2. Activate the plugin in the Plugins areas of the WordPress Administration page

3. Enter your gamertag and number of entries to display in the Options->360Voice Bits menu

4. Add vbsr_printEntry(); somewhere in your WordPress theme like your blog sidebar. Make sure this is inside a php block.

Planned Features

1. Pretty-up the text entry so it isn’t just a simple blob of text. Maybe integrate with a gamercard or plugin to one of the gamercard plugins.

2. Allow for more than the most current entry to be displayed. (Added in v1.3)
3. Cache the entry so that it is available even if the 360Voice API isn’t available and to avoid the need to keep requesting the same info on each page load. I’m sure those guys will appreciate it.

4. Whatever you guys come up with next!

17 Comments on “360Voice Bits Plugin”

  1. Mr Papa Says:

    This should be a widget… maybe I will convert it this afternoon…

  2. Chris Legend Says:

    I’d love to try this plugin out on my own Wordpress blog but I’m having issues.

    I’ve downloaded it numerous times and it refuses to be unZipped. I’ve even tried it on multiple computers (windows & Mac) with no luck.

  3. Saccia Says:

    UPDATE:

    Nevermind. I have fixed it. Apparently, IE is not too smart about file types and was requesting that the file be gzip compressed beforehand (since I have that set on the server) and then, it was not properly handling the content. I was able to set a server directive to make sure that zip files are not compressed again even if the browser asks for it. IE should work now for downloading. Thanks Chris. Enjoy the plugin and I await your comments/suggestions.
    ===============

    Chris, this is very odd. I am able to download it just fine in Firefox. But if I try to download this with IE, I get a corrupt zip file as well. If anyone has any ideas, I would appreciate any suggestions. For now, please use Firefox to download or contact me with the link on the top right and I will send you a copy.

    ===============

  4. Claudio Says:

    Hi :) Would very much like to try this, but… here’s the error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in 360voicebits.php on line 30

    Just thought I’d let you know. :)

    Thanks!
    Claudio

  5. Saccia Says:

    Okay, I have figured out what is wrong there, Claudio. I am using classes in this plugin to help avoid collision with other plugin functions. The issue is that classes changed quite a bit between php5 and php4 and the object model is not completely compatible.

    So, I have created another release just for php4. It is probably a good idea to upgrade to php5 when you can just because it has some good improvements. But, I will try to maintain two versions for as long as I can to support people still using php4. I do not have a php4 installation to test this with so try it if you have one. The one thing I would be concerned with it the XMLReader stuff. I am not positive that is available in php4 but the function reference table site is down right now so I cannot check.

  6. Mr Papa Says:

    LOL… ignore my first comment - misunderstood what you were doing…

    I have run into an issue playing around with it though… Your plugin breaks if there is a space in the gamertag.

    You need to change spaces to %20 in order to work with the API… You can use my gamertag Mr Papa 360 as an example.

    Mr Papa

  7. Mr Papa Says:

    Did you ever hear back from Claudio? Once I get past the space in gamertag issue, I run into an XMLReader issue like you suspected might happen. The error is:

    Fatal error: Cannot instantiate non-existent class: xmlreader in xxxxxx

    Mr Papa

  8. Saccia Says:

    Nice catch Mr. Papa. I didn’t think about gamertags with spaces. I’ll get that fixed. I did hear back from Claudio. His issue is that he is running PHP4. See my above comment for the explanation. If you have PHP5 or PHP5.1, you’ll need to make sure the XMLReader module is enabled. See this link to find how to do that for your PHP installation: http://us2.php.net/manual/en/ref.xmlreader.php

  9. Saccia Says:

    Version 1.2 contains the fix for gamertags with spaces. It also handles empty entries. Such as when the site is down or for new account that haven’t had their entries setup just yet.

  10. Mr Papa Says:

    Just sent you a version that works with php4…

    Mr Papa

  11. Saccia Says:

    Thanks to Mr Papa for the xml parser rewrite. This plugin will now work in PHP4 and PHP5 without any special XMLReader. It uses the builtin expat package for php which is enabled by default.

  12. brdweb Says:

    Just wondering if you’ll be converting this to a widget anytime soon?

  13. Saccia Says:

    I’m not sure what you mean by widget. When Mr. Papa mentioned this, I chatted with him and then he said nevermind because he thought I was doing something else. If you can give me a reference to WP widgets or an idea of what you need, I’d be happy to give it a shot.

  14. Melkir Says:

    I seem to be getting an extra meta character in the output when this plug-in is enabled that stops Windows Live Writer from parsing Wordpress output correctly, any ideas?

  15. Saccia Says:

    Aha! I’ve figured out what people were asking for when they asked to make the plugin a “widget”. I believe they are referring to this: http://wordpress.org/extend/plugins/widgets/. I’ll try to see what I can do to make it work as a Sidebar Widget.

  16. houserocker Says:

    Thanks for this great plugin!!

Comment: