swemoney.com

  • Random
  • Archive
  • RSS

AjaxyXML updated for Mephisto 0.8 (And, I’m back!)

For some reason, the last few months (no clue when this started, really), this blog has been running in a purely cached mode. Mephisto broke somehow and wasn’t even starting up anymore, so apache was just serving the static HTML pages. I just made the leap to 0.8 of Mephisto and cleaned everything up and I seem to be back up and running.. I had to update my AjaxyXML plugin for Mephisto to work with 0.8 so anyone who has been having problems getting it to work with the new version, it should work fine now. Nothing new was added, I just rearraged everything into the new plugin structure for Mephisto… So go grab that if your using Mephisto 0.8. If your still on 0.7, you’ll need an earlier revision.

    • #plugins
    • #mephisto
    • #ajaxyxml
    • #ruby on rails
    • #My Stuff
  • 3 years ago
  • Comments
  • Permalink
  • Share
    Tweet

New Facebook Gem/Plugin

I’ve been using the RFacebook Gem and plugin for my latest facebook application. It works great and all, but the things I’ve read about it are very true. It’s really not very ‘ruby’. I like all the features and it’s not too hard to use, but I’m sure we can do better to integrate facebook and rails in a prettier way. I’m wondering if anyone wants to collaborate on a new gem or a new plugin that would make things more Ruby-ish.

A few things I would love to see would be some form of meta-programming that could map calls to something like Facebook::User.getInfo, instead of fbsession.user_getInfo. Just looks nicer. I’d also love to see some form of Active Record integration. The acts_as_facebook_user helper is great, but it still requires you to call manually call a facebook API call from your controller to get user information. It would be great to have something like User.facebook_info[:first_name] without any extra effort. Just something to take the facebook data portion out of the controller and put it where it belongs, in a model. Last, but not least, RFacebook compatibility to maintain applications until they can refactor to use the new methods.

Anyone who wants to help out with this, I’d love to get some type of plan written up and some good people working on it to get something working quickly and well. Let me know!

    • #plugins
    • #ruby on rails
    • #facebook
    • #rfacebook
    • #My Stuff
  • 4 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Not my plugin’s fault!

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.

    • #plugins
    • #ruby on rails
    • #mephisto
    • #ajaxyxml
    • #My Stuff
  • 4 years ago
  • Comments
  • Permalink
  • Share
    Tweet

A more real-time AjaxyXML

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!

    • #plugins
    • #mephisto
    • #ajaxyxml
    • #ruby on rails
    • #My Stuff
  • 4 years ago
  • Comments
  • Permalink
  • Share
    Tweet

HowTo: has_many_friends

I’ve had a lot of requests for some sort of howto for my has_many_friends plugin for rails. I’m not wondrous at making howto’s, but I’ve been trying to rack my brain thinking of things I could demonstrate in a new post about how to use the has_many_friends plugin. So we’ll see what we can do. There won’t be any large code examples. I’ll just include a few snippets here and there, mainly because I wrote has_many_friends to have enough wiggle room so people can incorporate it in a few different ways. So let’s get started…

Read More

    • #plugins
    • #has_many_friends
    • #ruby on rails
    • #My Stuff
  • 4 years ago
  • 4
  • Comments
  • Permalink
  • Share
    Tweet

update for mephisto_ajaxyxml, now supports mootools!

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.

    • #plugins
    • #mephisto
    • #xml
    • #mootools
    • #ajaxyxml
    • #ruby on rails
    • #My Stuff
  • 5 years ago
  • 15
  • Comments
  • Permalink
  • Share
    Tweet

mephisto_ajaxyxml : Dynamic XML content for you Mephisto blog

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.

UPDATE: These instructions reference an SVN server that doesn’t exist anymore. Please visit the github repo to download it now.

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.

Last thing we have to do is add the code to our layout. Open up 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,

    • #plugins
    • #ruby on rails
    • #mephisto
    • #ajax
    • #xml
    • #mephisto_ajaxyxml
    • #My Stuff
  • 5 years ago
  • 8
  • Comments
  • Permalink
  • Share
    Tweet
iOS application development, video games, random thoughts, apple. These are a few of the wonderful things you'll catch on my blog.

Pages

  • Projects
  • Apps
  • Secret Browser

Elsewhere

  • @swemoney on Twitter
  • Facebook Profile
  • tehdnite on Youtube
  • dnite on Digg
  • swemoney on Rdio
  • swemoney on github

Twitter

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr