Release 0.2 of BookmarkIt! Sidebar Plugin for Typo

Well, version 0.1 was shortlived. There was a critical difference between running with WEBrick and running in production environment with fastcgi.
The value of env[“REQUEST_URI”] did not contain “http://host”. So I found a quick solution and we’ll see if there is a better solution tomorrow.

Current solution consists of replacing

@article_url = request.env[“REQUEST_URI”]

with

@article_url = ‘http://’+request.env[“HTTP_HOST”]+
  request.env[“REQUEST_URI”]
  if @article_url.eql?(@article_url.gsub(/http:/,”).gsub(/HTTP:/,”))

You live and learn…

bookmarkit-0.2.zip and
bookmarkit-0.2.tgz

Tags: , , ,

20 Responses to “Release 0.2 of BookmarkIt! Sidebar Plugin for Typo”

  1. nemonoid March 10, 2006 at 2:13 am #

    Hi,
    I was just about to try knock together something similar when I came across your post on typeforums. I’d love to try the plugin but your download links seems to be dead!

    nem

  2. Pascal March 10, 2006 at 2:13 am #

    Sorry about that! I guess Capistrano got in the way here. I’ll need to find a solution.
    In any case, the files are back where they belong.

  3. nemonoid March 10, 2006 at 2:13 am #

    Thanks a million, the plugin is excellent, just what I was looking for. I guess I’ll have to find something else for my first foray into Typo plugins :)

    nem

  4. Pascal March 10, 2006 at 2:13 am #

    Thanks!

    How about writing a sidebar plugin to list the most recent articles in a category, or the most recent articles in a tag?
    Or one to list the most popular articles (that one is a bit more tricky because Articles would need to keep track of impressions.
    That was next on my list, but would gladly let you take a stab at it!

  5. Devlin Palmer March 10, 2006 at 2:13 am #

    I just tried installing, and instead of displaying the tiny images, it displays the text in large (22px) text. Is it meant to be like this, or how can I change it to be images, as on this website?

  6. Pascal March 10, 2006 at 2:13 am #

    Devlin,
    when you extract the archive, it will extract everything into a directory named bookmarkit, this directory contains a _public_ directory the content of that should be copied to your own public directory. At runtime, it will expect to have the images under [root URL]/images/bookmarkit/.
    For example, here, the picture for delicious is under http://blog.nanorails.com/images/bookmarkit/delicious.gif

  7. tanguy:r March 10, 2006 at 2:13 am #

    Hi there,
    Just so that you’re informed, the plugin seems not to work with trunk. I get an infamous “Application error (Rails)” while rendering the sidebar block in the Admin panel. Rails seems to be waiting for a template config ?…

  8. Pascal March 10, 2006 at 2:13 am #

    Tanguy, did you try the version attached to [Upgraded to typo 4](http://blog.nanorails.com/articles/2006/08/08/upgraded-to-typo-4-0)

  9. tanguy:r March 10, 2006 at 2:13 am #

    Thanks for the update :)
    Unfortunately, it won’t work neither. I’d probably better upgrade my rails first…

  10. Pascal March 10, 2006 at 2:13 am #

    :(

    What revision of typo are you using? Typo has its won version of rails. They recently changed the sidebars, so that may be why.

  11. tanguy:r March 10, 2006 at 2:13 am #

    You’re right, it would probably not help.
    I’m using Typo 4.0.3, installed from svn trunk.
    As a matter of fact, reading through the logs won’t help, as it just tells of an “unimplemented” error :/
    I’ll try to find out what happened exactly and let you know ;)

  12. Joe Rosenblum March 10, 2006 at 2:13 am #

    Hi, I updated the code to work with typo 4.0. Down load this tar file and unpack it into your components/plugins/sidebar directory. It’s just two files now (instead of three):

    * bookmarkit_controller.rb
    * bookmarkit/content.rhtml

    You’ll still need the images from Pascal’s original code. Happy bookmarking!

  13. Pascal March 10, 2006 at 2:13 am #

    Excellent, Joe. Thank you!

    Chris, you should try Joe’s version.

  14. Jesse March 10, 2006 at 2:13 am #

    Not showing up for me either – applied the 2 files above for 4.0. My version is 4.0.3.

  15. Pascal March 10, 2006 at 2:13 am #

    Jesse, did you try the [version for 4.0](http://blog.nanorails.com/articles/2006/08/08/upgraded-to-typo-4-0)

  16. Jesse March 10, 2006 at 2:13 am #

    Yes – I replaced the files in the version above with the version for 4 (there were 2 of them).

  17. Pascal March 10, 2006 at 2:13 am #

    I see. I haven’t upgraded to the latest version. It usually is quite a bit of work with some of the custom stuff I have.

    I’ll take a look this coming week and may use a different approach like I did for the TextLinkAds plugin (which is just a basic rails plugin, and no longer a typo plugin). This will avoid breaking all the time, and be a better approach to integrate it in a post.

  18. Pascal March 10, 2006 at 2:13 am #

    Jesse, there is new (and improved) version of the plugin. Chec it out in this [new post](http://blog.nanorails.com/articles/2006/12/18/bookmark-it-rails-plugin-for-adding-bookmarklets)

  19. Jesse March 10, 2006 at 2:13 am #

    awesome! Thanks – that totally worked, and I have them showing on individual article pages now too!

  20. Pascal March 10, 2006 at 2:13 am #

    :) you are welcome