Archive for the 'Programming' Category

Linked plugin modified

Posted by srejbi on April 25th, 2008

Recently I have integrated my blog with Twitter. Then started to use the Shareaholic plugin for my Firefox to post URLs to Twitter as I surf.

I noticed that though Twitter converts the plain text URLs to clickable links while displaying on Twitter, links were not coming up as links but as plain text URLs in my WordPress posts.
So I installed the Linked WordPress plugin, but unfortunately it was not handling links correctly - only the domain part of each URL was converted to a link. (Now with each URL pointing tohttp://tinyurl.comdoes not look too pro, does it? :) )

After spending some time by checking the plugin’s code, I have found a solution that works for me.
I changed linked/linked.php on line 200, from

$content = preg_replace(’((>|\s)(http:\/\/[a-zA-Z0-9]+(\.[a-zA-Z_]+)+))’, ‘<a href=”$2″>$2</a>’, $content);

to

$content = preg_replace(’((>|\s|\(|\n|\r)(http:\/\/[a-zA-Z0-9]+(\.[a-zA-Z_]+)+([a-zA-Z0-9\/]+))
(\s|\)|\n|<))’ , ‘<a href=”$2″ target=”_blank”>$2</a>’, $content);

This did the trick for me, and now the complete URL is converted to a clickable link…

Experiment & enjoy!
(Download the source file from here: Linked WordPress plugins linked.php zipped)

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Ruby, Ruby-on-Rails

Posted by admin on March 19th, 2008

Recently I have started learning another object oriented programming language, Ruby, together with its’ web application development language, Ruby-on-Rails (RoR, aka. Rails), in order to help an old buddy of mine with some of his web development projects.

Ruby, and Ruby-on-Rails has gained quite some fame in the past few years, probably thanks to Rails, allowing lightspeed web developments, within certain boundaries (mostly of knowledge, as usual :)).

After some time (~160h) playing with Ruby, it seems like an efficient and well-structured, easy to learn. The Rails framework is a framework of coding standards, code-structure, templates and commands. And not to forget Gems and plugings, which also makes Ruby a rapid application development tool; there is a wast number of code available for Ruby, no need to reinvent the wheel (unless you need some special tyres ;)).

However my experience in this subject is not yet entitling me to write an academic post about it, but thought it’s a good idea to share some of my findings on the subject, for any one who is in the same shoes, looking for some entry points to the world of programming Ruby…

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]