swemoney.com

  • Random
  • Archive
  • RSS

Mephisto2Tumblr should be ready for public consumption

I haven’t extensively tested this and have only used it on my own Mephisto database so I can’t guarantee anything but I figured I’d release what I have in case it helps anyone else out. The code is small enough and easy enough to read that it should be very easy to modify if you have specific needs. Head to the Mephisto2Tumblr GitHub repo if you want to give it a shot!

    • #mephisto
    • #tumblr
    • #mephisto2tumblr
    • #blog
    • #script
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Small oversight with my script

The script I wrote to convert all my articles over from Mephisto to Tumblr seemed to work rather well but I just noticed a small oversight on my part. Any article I marked with a “read more…” seemed to only come over from the point after the jump. I’ll take a look at this more tomorrow and see if I can’t clear it up.

    • #mephisto
    • #tumblr
    • #mephisto2tumblr
    • #blog
    • #script
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Finally finishing the blog move..

I just spent most of the day writing a small Ruby script for converting my old Mephisto blog to Tumblr. It’s quite late so I’ll clean up the script and release it for anyone else who might want to use it tomorrow or later this weekend. I still have a couple of things to move over manually before I can shut down Mephisto for good but this has been a long time coming and I’m happy to finally be almost done.

I’ve been a huge slacker on the blog lately. Hoping to fix that and start blogging more. More on what I’m doing and working on coming soon! Goodnight!

    • #move
    • #blog
    • #mephisto
    • #tumblr
    • #ruby
  • 1 year ago
  • 1
  • Comments
  • Permalink
  • Share
    Tweet

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

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

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_relative_time :: Relative time in a liquid tag

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!

    • #ruby on rails
    • #mephisto
    • #irc
    • #sounds
    • #fscript
    • #scripts
    • #My Stuff
  • 5 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Smallest fix for ajaxyxml

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!

    • #ruby on rails
    • #mephisto
    • #ajax
    • #xml
    • #mephisto_ajaxyxml
    • #My Stuff
  • 5 years ago
  • 3
  • 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

Ajaxyxml is almost here!

I’ve been working on a plugin for mephisto that will fetch and parse an xml file through ajax so you can keep your mephisto cache in tact and still display dynamic content on your site. I’ve got almost everything ironed out and it should be ready for public consumption very shortly. The main problem I’ve been having is getting around the fact that Rails is not ‘Thread-Safe’, which means that I have a plugin that works pretty flawlessly under 1 mongrel instance, but if you have a cluster, things start to break down. I will figure it out shortly and I will release very soon so for the few people I’ve gotten interest from, just another day or two, I promise.

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

A couple fixes.. Some news..

I finally went ahead and whipped up a quick hack for mephisto to allow me to keep my twitter status and last.fm status updated without killing mephisto’s great caching features. Previously, I was using Dan Webb’s lastfm plugin for mephisto, and my recent modification to the same plugin to make it fetch twitter information instead of lastfm information. This works, to a degree, but the problem comes from the fact that this plugin uses a liquid tag that embeds the xml information on the page. What this means, is that mephisto will cache the page with the current status or lastfm list and recent updates won’t appear until the cache gets flushed. I know there’s a ‘setting’ in dan webb’s plugin that allows you to change the time in which mephisto will auto flush the cache and try to update the page, but it never worked for me.

What I did was create an Ajax request at the bottom of the page that updates the twitter and lastfm information on the fly. This means that the page that mephisto caches will always stay the same. The updates to twitter and lastfm will happen behind the scenes and update the page w/ javascript. Sucks for those of you who don’t have javascript enabled, but works for me. x=)

I want to whip up a versatile plugin for mephisto with this functionality, but that might take a little bit of time for me to pull off correctly and all. I just started a new job serving at a comedy club in the area, so that’s going to take some of my time in the near future, but I promise that as soon as I get some time and figure out how I want to do it, I’ll get this out in a plugin form. It won’t be a plugin just for twitter and mephisto. I want to make it so you can parse any xml file and update any element on your page with that information on the fly so you can keep dynamic content on your site without killing the caches. Stay tuned for more info on this.

    • #ruby on rails
    • #twitter
    • #mephisto
    • #life
    • #last.fm
    • #My Stuff
  • 5 years ago
  • Comments
  • Permalink
  • Share
    Tweet

New look

Ya, I’ve only been using mephisto and the skittlish theme for 2 weeks or so, but I got bored with it already and found micro to be much more clean and simple. I took the evening to edit it to suit me and am pretty happy with the way things turned out. This one might stick for a little bit longer than 2 weeks. We’ll see, folks. x=)

    • #mephisto
    • #life
  • 5 years ago
  • Comments
  • Permalink
  • Share
    Tweet

Mephisto Plugin for Twitter

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!

    • #ruby on rails
    • #twitter
    • #mephisto
    • #halo
    • #facebook
    • #haloplayers
    • #My Stuff
  • 5 years ago
  • 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