Facebook: Bug with URL encoding

Today, while I was working on the URL encoding for the recently released Facebook-style Links module, I realized a bug with Link Attachments feature on Facebook. Before I explain, let us reproduce it:

Try to attach the following link on Facebook: http://google.com/search?q=blenders%26pride. This URL actually queries Google for ‘blenders&pride’. Facebook converts/encodes the above URL to http://google.com/search?q=blenders&pride which is not the same as above and queries Google for just ‘blenders’.

So, why Facebook does this? Probably Facebook tries to encode the URL to remove the characters which are not allowed by RFC 3986 and replaces them with their percent encoding. But there are certain characters which should not be encoded, such as ‘/’, ‘?’, ‘#’, ‘@’ which are the reserved characters and used as delimiters in the URL. So, it decodes these characters and converts their encoding to the original character which gives rise to the problem. Let us see an example:
Continue reading

Drupal: Tutorial for Feeds Image Grabber

Feeds Image Grabber (FIG) was released on 3rd March, and currently supports the following features:

  1. Automatically downloads and attaches image to the node created by Feeds module.
  2. Configurable XPath of the desired image location on the webpage of the feed item on per feed basis (using element’s id or CSS class).
  3. Support for FileField Paths module.
  4. Configurable maximum image size.
  5. Configurable minimum and maximum image resolutions.

In this post, I will briefly demonstrate how to configure the settings for FIG to efficiently grab images for feed items.
Continue reading

Drupal: Facebook-style Links

Facebook-style Links (FBSL) provides the ability for users to attach and submit links along with their Facebook-style Statuses. Combined with Facebook-style Statuses (FBSS), the FBSL module provides an attach link form that loads via AHAH. Users can then attach a link with an (optional) thumbnail, title and description to their status. In the nutshell, it imitates the link attachment feature on Facebook.

screenshot-londonfuse

Screenshot of FBSL on LondonFuse.ca


Continue reading

Drupal: Feeds Image Grabber

Feeds Image Grabber (FIG) is the successor project for FeedAPI ImageGrabber to support the Feeds module. FIG parses the Item URL of each feed-item, downloads the appropriate image from the post and maps it to an image field in the node created by Feeds module for that feed-item.

[Google Reader (with thumbnails) can be imitated on a Drupal site by using Feeds, Feeds Image Grabber, FileField, ImageField, ImageCache, ImageAPI and Views module].

Continue reading

“What is Drupal?”, for newbies

I often come across this question from my friends and peers and most of the time I deflect it by saying “it lets you create your website easily, why don’t you look up on Wikipedia?”. Few days ago, one of my friends pointed me that most of the articles start with “Drupal is a Content Management System(CMS) …” which becomes pretty much confusing when one has no idea about what a CMS is. In this post, I have tried to explain what a CMS is and why we need it and how Drupal stands out among various other available CMSs.

Let us say you need to create a webpage for your website. Ideally, it would mean you create HTML content that will be delivered to someone who requests it through their web browser. Eventually you grow big and decide to add 100 more pages to your website and therefore create 100 more HTML pages. But then you realize that there is a lot of duplicate content. The footer which contains the copyright information is essentially the same on all pages, therefore if you ever need to edit it then it would mean to edit these 101 pages. This will be a lot of redundant work.
Continue reading

Dumping a remote SVN repository without admin access

When you need to dump a SVN repository, all you have to do is

svnadmin dump REPOS_PATH

But wait, then you need to have admin access to the server on which your SVN repository is hosted. Often, that is not the case and you have to contact the company which hosts your repository to do it for you. I have a repository hosted at CVSdude and I needed to dump it. As I am on the Developer Edition plan, I do not enjoy the privileges to backup my repositories from my admin panel. I could have mailed the guys at cvsdude, who according to me are quite supportive and quick to respond, but that would have taken longer than what I am going to describe next.

SVN provides a unique utility, svnsync which is a Subversion remote repository mirroring tool. Put simply, it allows you to replay the revisions of one repository into another one. Now, we can create an empty repository on our local system, synchronize it with the remote repository and then dump the local repository. Follow the following 4 step process to have a dump of your repository:
Continue reading