By Nitin on May 8, 2010
I discussed a little about URL encoding in my recent post Facebook: Bug with URL encoding, although it seems like the bug still exists. In this post I will discuss “how to encode a given URL before accessing it using CURL or fsockopen”. The problem with URLs is that they might contain certain disallowed characters like spaces, according to RFC 3986. Our aim is to convert these invalid characters to their percentage encoded values in a given URL , so that we can access the URL using our regular HTTP request methods. For example the URL [http://example.com/space space] should be converted to [http://example.com/space%20space] before we can access it using CURL. However, the URL [http://example.com/percents%25percent] is perfectly valid as it doesn’t contains any of the disallowed characters.
Continue reading “PHP: Encoding a URL before accessing it”
Posted in Nitin's Blog | Tagged encoding, facebook, php, URL
By Nitin on May 3, 2010
We visit and revisit web pages. You will find that more than 60% of your web visits are actually revisits of some sort. But web browsers support for such revisitations is limited to bookmarks, history list, URL auto-completion and back button. Here are a few history tools which can greatly improve your experience during web browsing.
- Tab History: It is the simplest yet very useful extension. Usually when we open a link in a new tab, the back button history for the new tab is empty. This extensions adds the session history from the parent tab to this new tab, so that you are not lost with the question “where do i come from?”.
- Tree Style Tab: This extension arranges your tabs in a tree structure, like a folder tree of Windows explorer. So whenever you open a new tab from a link, this tab is added as ‘child’ node in the tab tree of the parent node.

Tree style tab
You can conveniently arrange these tabs in the tree using the simple drap and drop feature. You can go through an extensive list of features on the official site. One thing I would like to mention is that if you close a tab, its children are orphaned. As the father is gone, no way children would know about their grandparents
.
Continue reading “Firefox extensions to improve history tools”
Posted in Nitin's Blog | Tagged addons, extensions, firefox, history
By Nitin on April 25, 2010
Some of the “quotes” I like from South Park, by Chef.
Disclaimer: The following contains coarse language and due to its content it should not be viewed by anyone.

Chef with Boys
Episode 401
Chef: Well look at you cute little crackers with your money and your fancy clothes and your cell phones. It’s almost like you were… Oh my God! Children, what have I told you about drugs
Stan, Kyle, Cartman, and Kenny: There’s a time and a place for everything and it’s called college.
Continue reading ““Hey Chef”, South Park”
Posted in Nitin's Blog | Tagged chef, fun, south park
By Nitin on March 12, 2010
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 “Facebook: Bug with URL encoding”
Posted in Drupal, Nitin's Blog | Tagged bug, encoding, facebook, fbsl
By Nitin on March 6, 2010
Feeds Image Grabber (FIG) was released on 3rd March, and currently supports the following features:
- Automatically downloads and attaches image to the node created by Feeds module.
- 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).
- Support for FileField Paths module.
- Configurable maximum image size.
- 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: Tutorial for Feeds Image Grabber”
Posted in Drupal | Tagged Drupal, feeds, fig, imagegrabber, tutorial
By Nitin on March 3, 2010
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 of FBSL on LondonFuse.ca
Continue reading “Drupal: Facebook-style Links”
Posted in Drupal, Projects | Tagged Drupal, fbsl, fbss, module