Loading twitter status...
/ 10.Dec.2007
It’s amazing what a whole day of work (with the occasional Halo 3 break) will do for you. Last night when I updated, I felt like I had so much to do to get my application cleaned up and ready for prime time again. Since I’ve been planning on this 1.5 release to be a larger release, I haven’t been very careful about breaking stuff. I’m pretty OK with that though. I broke things on purpose because I knew I could implement them better. The only problem with it, was that my brain KNEW a lot of things were out of order but didn’t know exactly what. So after a day of fixing everything up, I’m back on track. The challenges backend is pretty solid. A few tweaks here and there are going to be needed, but it definitely works. I still need to pretty it up a bit too. The biggest accomplishment of the day, though, was reworking the flash system. Since I drop things like updating gamertags to the background, the user doesn’t get to see what’s happening. I have to use memcached, and check to see if the process is done. I kind of wrote myself into a corner with the old code because it was pretty much ONLY used for updating the gamertag. Now that I have some extra methods (like creating and finishing challenges) that need to be done in the background too, I had to make the system more flexible. I feel like I did this really well and it should work for me in the future if I have to add some more functionality to it.
On today’s agenda, I’m hoping to finish up the loose ends of the Challenge backend and get the views to a nearly complete state. I’ll probably continue to test out everything as I go along to make sure I didn’t overlook anything that I thought I fixed up. Some of the things I changed for this release sounded like a huge task in my head, but ended up only taking me about 10-15 minutes to do. One thing I changed that I thought would take me a while was switching from @user.id to @user.facebook_uid for all my user stuff. I thought it looked kind of silly to have haloplayers/user/123 which would like to the facebook id or 137412794. Using the facebook id for EVERYTHING (except database associations because I couldn’t really figure out how to get away from the primary id on that) took away a lot of confusion. Lessons learned.
Anyways. That’s about all I got. I don’t know why I’ve gotten into the rambling mood the last couple of days. I think I’m going to try and get a couple hours of sleep before I wake up and start working some more. Good night, folks!
/ 09.Dec.2007
Halo 3 Players hasn’t been out for a month yet. I believe the first day it went live was November 20th. That doesn’t mean I’ve just been sitting back and watching the user count slowly grow for a few weeks now. Since it’s initial release, I don’t even recognize parts of the application any more, let alone the code! Anyways.. Since I don’t update here as often as I’d like, I’d like to ramble about my first large update to Halo 3 Players since it was released.. I don’t expect to make a whole lot of sense, but I just want to collect some of my thoughts here to better make sense out of them and if anyone happens to actually READ this, maybe they can offer some input.
The largest thing that users of Halo 3 Players will notice is the addition of Challenges. I have bigger ideas for challenges, but for the initial 1.5 release, the user will be able to challenge themselves in a speed game. You set the number of something you want to increase and see how fast you do it. If you want to see how quickly you gain 5 EXP points, set up the challenge and play. When your done, we’ll record your time and show your friends so they can take a stab at trying to beat your time. The concept is simple and I think it will add a lot more of a social aspect, not to mention, competition. I’ve got most of the back end roughly finished. It definitely needs a lot of polish, but it works. I intend on going through most of my code and refactoring some things to work a little better before this release and that should help me clean up the new challenges code too. One of the larger problems I’m running in to is that some of the tasks that require me to fetch information from bungie.net take a few seconds to complete if bungie.net is going slow. I implemented a system that spawns these update processes to the background and I use memcached to store information about what’s happening. This worked OK for updating the gamertags, but when since I’m moving it over to more aspects of the application, I’m definitely going to need to rewrite some of that code to be more flexible. I’d also LIKE to figure out some way to use AJAX to constantly check the status of the background updates and refresh some things automagically when it’s done. We’ll see if that makes the 1.5 release or I wait until 1.6 for that one. I hope I can get 1.5 out by the middle of the week. That would be great.
On a side note, I’m really enjoying working with the Facebook Platform. It didn’t take a whole lot of work to learn how things worked and my obsessive-compulsive nature really loves how clean things look when your application blends in with facebook so well..
I think I’m done rambling about this stuff. It’s 5am. Time for a little bit of sleep before I get back to work..
/ 09.Dec.2007

Update: Haha.. I wrote this about 2 weeks ago but I guess I accidentally checked the ‘draft’ button so it never published…
/ 14.Sep.2007
PeepCode has released the 3rd installment of their 3 part rSpec guide in screencast form. I’ve bought and watched the other 2 and am currently downloading #3 as we speek. All the screencasts I’ve watched from PeepCode have proven to be very informative.. so I figured I’d take the time to promote them a little bit on my own. Head on over to peepcode.com and check them out. The screencasts cost $9 but it’s very worth it and highly recommended. A lot of the money goes right back to the community for various projects as well. Go check it out now!
/ 08.Sep.2007
So, originally, I had posted with little response asking if anyone knew of a weird caching mechanism that was preventing my mephisto_ajaxyxml plugin from updating twitter status right away. I swore I tested this before, but it was brought to my attention that the XML file itself (if you load it up on your browser) just doesn’t update. I’m not quite sure why this is and I’m going to see if I can find anything online about it, but at least I can rest a little easier about trying to fix that part of my plugin.
Besides that, I am going to be releasing a new version of mephisto_ajaxyxml in the near future though. I want to add support for other formats, like RSS, ATOM and possibly JSON. I’ll also be looking into what else I could add easily. If you have any suggestions for what you’d like to see in the ajaxyxml plugin, let me know.
/ 07.Sep.2007
A new site for Rails plugins has popped up and it looks really nice. Railsify! is it’s name and I added my has_many_friends plugin to their catalog. Just thought I’d point a few people in their direction. Let’s populate their site with all the great rails plugins! Don’t forget to favorite/comment on my plugin too! x=)
P.S. OH YA! And become my fan! x=)
/ 10.Aug.2007
One of the reasons I created the AjaxyXML plugin for mephisto was to put more real-time data on your mephisto blog without killing your caches. AjaxyXML works pretty well, but it’s still not quite as ‘real time’ as I would like it. When I update my twitter status, it still takes a good amount of time to update on the blog even though it’s pulling in the XML file AFTER the entire page is loaded and just replacing the data in the div. I’m at a loss about why this happens and would love it if anyone wants to take a look at the source and give me any idea’s on how to fix this. I’m assuming there is some sort of caching that I’m not seeing that’s automatically caching the XML file, but I can’t seems to find this and am unsure how to fix it. If anyone has any ideas, please comment here. I would love to hear what you have to say. Thanks!
/ 29.Jun.2007
I’ve officially joined the ranks of the 97% of rails developers who develop on a mac. x=) It’s kind of an exciting time for me because this is my first mac and all. I got the low end macbook pro. Maybe in a year or 2, I’ll upgrade to a higher end model but for me, this works great! Anyone with tips or tricks or any advise for new comers to a mac, feel free to leave me a comment! More updates soon.
/ 12.Apr.2007
I updated mephisto_ajaxyxml to support mootools for those of you who prefer to use the lighter weight mootools instead of prototype for your blog. As long as you have Ajax, XHR and Element support in your mootools download, you should be fine (If you select Ajax, it should automatically select a bunch of other stuff, the above included). To use mootools, just add the framework: ‘mootools’ option to the ajaxyxml tag.
{% ajaxyxml url: 'http://twitter.com/statuses/user_timeline/swemoney.xml', element: 'twitter', quantity: '1', framework: 'mootools' %}
I updated the 0.1 ‘release’ of the plugin to support mootools as well but I did not change the tag name or version number. Just make sure you have revision 20 or above and you should have mootools support for non-edge mephisto.
/ 10.Apr.2007
When I signed up for twitter not too long ago, they had a nice item right in their xml file called relative_created_at that would return a time in relation to ‘now’ instead of the ugly ‘created_at’ which is a normal timestamp. The have since removed this item from their xml file (for caching reasons that are very understandable) so I went ahead and created a tiny plugin that provides you with a filter to use that form of time in any of your liquid plugins. You can pass any date as a string and this filter will convert the string to a Ruby date object and return the relative time from now that the date was. Check out the README or the source.
script/plugin install -x http://svn.dnite.org/mephisto_relative_time
The installation is quite easy. Just run the above and restart mephisto. To use the filter in your blog, do one of the following in any liquid template file.
Something happened {{ date_variable | relative_time_ago }} ago.
My birthday was {{ "2006-07-17" | relative_time_ago }} ago.
My birthday is coming up in {{ "2007-07-17" | relative_time_to }}
date_variable is just some liquid variable that contains a string with a date in it. The other 2 are examples that you can create any date in a string as long as Ruby can convert it correctly into a date object. The relative_time_ago function will return how long in the past from now said date happened, and the relative_time_to method will give you roughly how long until said date is reached. Piece of cake, eh? Now have fun with it!
/ 10.Apr.2007
If you happened to grab the mephisto_ajaxyxml plugin just after it was release, you may want to update to revision 17. A weird bug about the application controller not reloading or something cropped up but I was able to fix it pretty easily. Weirdest thing was that I think it only affected the trunk/edge release and not 0.1. Other than that, I haven’t found any huge show stopper bugs. So test away and let me know what you think. It’s currently 4 in the morning, so I must sleep now, but I think tomorrow I’m going to work on making the plugin parse rss/atom feeds as well as add a little more error/syntax checking/handling. I’m also thinking about adding either a standalone filter for mephisto or a small extra part to this plugin that will give twitter back it’s ‘relative_created_at’ functionality. Stay tuned for more!
After spending a good week trying to get around the non-safeness of class variables when threads are concerned, I finally got a release of my new plugin to share with you all! I haven’t done a whole lot of testing, but it does seem to work. So, if you have any bugs or suggestions, don’t hesitate to pass them on to tehdnite at gmail and I’ll see what I can do about them.
First things first, a brief introduction. Ajaxyxml is a mephisto plugin that makes it easy to fetch any (at least I’m pretty certain it should parse any) XML file from the internet and aggregate the contents into whatever form you want on your blog. The difference between this and the other plugins that parse XML data is that this works via teh Ajax. Instead of needing to flush your cache to update that small section of your blog that has dynamic content on it, it’s fetched on the fly. If you want to jump right in, go ahead and read the README file and get started. For those of you using the latest stable release of Mephisto (0.7.3), you’ll need to grab the 0.1 version, anyone using the most up to date mephisto from SVN can use either 0.1 or the latest trunk.
To install for ‘Edge Mephisto’...script/plugin install -x http://svn.dnite.org/mephisto_ajaxyxml/trunk
Or if your using 0.7.3…
script/plugin install http://svn.dnite.org/mephisto_ajaxyxml/tags/0.1
Also, if you using the 0.1 release, you will need to add the following line to your config/routes.rb file ABOVE the Mephisto::Routing route…
AjaxyXml.connect_with map
You should be all set to use the plugin now. Restart mephisto to load up the plugin. Using the plugin is easy but requires 2 steps. First, you’ll want to create a partial file. Let’s use twitter as an example for this. Go to your admin interface for mephisto and select Design and New Template. We’ll add the following code.
<p>My current Twitter Status: {{ xml.text }}<br />
It was set on {{ xml.created_at }}</p>
Now let’s name it. This plugin needs it to be named a certain way. It must start with _ajaxy_ and end with the name of the element you wish to be updated on the template your going to be using this tag on. Let’s call it _ajaxy_twitter_status. Click Create Template and verify that it exists on the right. Mephisto should have appended a .liquid to the end.
layout.liquid and add the following. (Also, if you don’t have prototype load up already, make sure you add {{ 'mephisto/prototype' | javascript }} somewhere inside the HEAD of your layout)
<div id="twitter_status">Loading Twitter Status</div>
{% ajaxyxml url: 'http://twitter.com/statuses/user_timeline/swemoney.xml', element: 'twitter_status', quantity: '1' %}
This will add a DIV that will say ‘Loading Twitter Status’ and an Ajax request right under it. As soon the Ajax request gets back, the twitter_status DIV will get updated. The only big ‘weird’ thing I found with this release is that the tag is really picky about line breaks. Just make sure there are NO line breaks in the {% ajaxyxml %} tag at all./ You can put the ajaxyxml liquid tag anywhere on your page as long as it lands after the element you wish to update with it. I like to throw mine at the bottom of the page.
That’s about it. I tried to make this introduction article as non-technical as possible, so for those of you who thought this was all obvious, I apologize. If you have any comments, suggestions, complaints, or whatever don’t be afraid to leave some comments! Enjoy!
UPDATE : I added some support for mootools, read about it here,
/ 22.Mar.2007
I’m late to the bus. I just found twitter yesterday and I think it’s a pretty cool concept. It’s nothing entirely useful, but it’s just fun. Don’t get me wrong, I’ve HEARD of twitter, just never tried it out until yesterday. Also, yesterday, I started screwing around with Dan Webb’s mephisto plugin for lastfm. What do these 2 things have in common you might be wondering? After looking at how easy it was to grab an xml file with users timelines from twitter via their api, I realized how easy it would be to modify Dan’s excellent lastfm plugin to work with twitter. So that’s what I did. I created a quick edit of the lastfm mephisto plugin to create my very own twitter mephisto plugin!
It seems to work pretty well. I’m actually intending on making it a little more feature packed in the future. There’s not a whole lot more you can do with it considering Twitter’s super duper simplicity, but I might take a stab at adding basic authentication so you can view ALL of your timelines with this plugin or maybe even come up with some way that you can edit create new status messages from your blog or your blogs admin page (when mephisto matures a little more to support admin plugins). Anyways, enough blabbing by me. Here’s the 411 on how to use it.
Install it like so from your mephisto root.script/plugin install http://svn.dnite.org/mephisto_twitter
Restart your mephisto (I’m pretty sure this is necisary to load up the new plugin) and you can edit your layout page (or any of your liquid pages) to include your twitter status!
{% twittertimeline user: 'swemoney', type: 'user_timeline' as status %}
{{ status.text }} - {{ status.relative_created_at }}
{% endtwittertimeline %}
If you want to know where your at in the loop, twittertimeline.index will return that for you. Any questions, post them here!
/ 19.Mar.2007
I can finally say that I’m settled in here. I’ve gotten to a point where there’s not a whole lot I need to set up on the new server any more and I’ll be doing a lot more work w/ ruby on rails and linux in general. So post count will increase here in the very near future. Out of boredom, I wrote a new Ruby script that burns an audio CD from a directory of mp3 files. I’ll go ahead and post that here when I get home just for shits and giggles. Anyone who might be looking for a Rails developer for a project, get in touch. I wouldn’t mind some real work.
/ 14.Mar.2007
Even though the Trac has been up for a week, the plugin hasn’t really been in functional order. Today announces the first real ‘release’ of has_many_friends!
I wrote a pretty big handful of tests for an application I’m working on know and the plugin passed pretty well like. The next step is to extract some of the tests and insert them into the plugin. I really need to figure out a good way to do this because everyone has a different user information and different information that’s required and must be validated, so I’m having a hard time thinking of a good way to implement tests that will validate and be pretty transparent. If anyone out there has some idea’s, let me know. Id love to hear them.
I’m also very open to any suggestions or comments about the plugin in general. Even though adding tests directly to the plugin would be great, it’s the plugin itself that deserves the attention. So have a look, or give it an install and tell me what you think. Let me know what could be done better. Let me know what was terrible about it or what you really liked. I still have a lot to learn and enjoy any feedback you can give. If you wish to jump right in, use the command below..
script/install http://svn.dnite.org/has_many_friends
UPDATE: HowTo (of sorts) has been written and availiable here. Check it out if your having trouble using the has_many_friends plugin.
micro theme by seaofclouds, edited by me, and powered with Mephisto
Latest Comments
"I think this will add another f..."
ikebana / 30.Jun.2008 at 07:11am
"Thanks, you just saved me a ton..."
ryan sobol / 20.Jun.2008 at 10:43am
"To answer my own question: ..."
maran / 16.Jun.2008 at 07:08am
"I get “uninitialized cons..."
maran / 15.Jun.2008 at 09:41am
"Hello! Every regard! :) charmin..."
cilais / 07.Jun.2008 at 05:07am