Drupal Based Mortgage News Aggregation Site with Social Networking Features

Posted on October 13th, 2009 by Shibu Basheer

Cabot Solutions is pleased to announce the release of Mortgagespeak.com which is the latest product developed for a Marketing firm located in Chicago.   The primary stakeholder of the site Greg Janecka had conceived the idea of developing a news and networking site that catered to the needs of the Mortgage industry in the United States.

Cabot proposed to develop the site using Drupal which brought many features out of the box including Blogs, memberships, Polls, and a powerful admin area to manage content of the site.   Some of the innovative features we built are:

1. RSS aggregation into Drupal.
2. Facebook connect allowing facebook users to login and participate easily.
3. Display latest twitter post via twitter API.
4. Highly interactive home page news listing using JQuery.
5. RSS feeds for different news categories.
6. Newsletters.
7. Configurable Advertisement module to display sponsorships.

See the site here.

Mortgage Speak Screenshot

Mortgage Speak Screenshot

  • Share/Save/Bookmark

Cabot Solutions Joins the Constant Contact Business Partner Program

Posted on October 4th, 2009 by Shibu Basheer

Cochin, India – 1st October 2009 – Cabot Solutions today announced it has joined the Constant Contact Business Partner Program to provide its clients with easy-to-use email marketing and online survey products to help them build strong, lasting customer relationships. Constant Contact®, Inc. is a leading provider of email marketing and online survey tools for small organizations.

“Our customers are always looking for effective ways to deepen and strengthen relationships with their customers as an efficient means of growing their businesses,” said  Shibu Basheer. “Constant Contact’s customer communication tools give our clients a valuable addition to our core services. Because of the tools’ ease-of-use and affordability, the Constant Contact partner program was a great solution to meet our clients’ marketing needs.”

“Email marketing and online surveys are proven tools that help small businesses connect with customers and build successful relationships with them,” said Len Bruskiewitz, senior director, Partner Programs, Constant Contact. “We are pleased that Cabot Solutions chose Constant Contact to provide its clients with our online marketing tools, and we look forward to working together to help Cabot Solutions be an even bigger factor in its customers’ successes”

As a Constant Contact Business Partner, Cabot Solutions is able to provide its clients with email marketing and online survey capabilities. With Constant Contact Email Marketing, Cabot Solutions’s clients can quickly and easily create professional-looking emails, manage email contact lists, measure email campaign results from clicks to open rates, and review who joined an email list. With Constant Contact Online Survey, Cabot Solutions’s clients have an easy-to-use tool to gather feedback that will help them meet customer needs, generate new ideas, and grow their business or organization. The tools will also help Cabot Solutions’s clients analyze responses quickly, create targeted email lists based on survey responses, take action, and follow-up with relevant email communications.

About Constant Contact, Inc.
With more than 300,000 customers Constant Contact, Inc. is a leading provider of email marketing and online survey tools for small businesses, non-profits, and member associations.  Founded in 1995, Constant Contact helps small organizations grow stronger customer relationships by delivering professional, low cost, easy- to-use online tools backed with award-winning support, education and personal coaching. Constant Contact is a publicly traded company (Nasdaq:CTCT) with offices located in Waltham, Massachusetts and Loveland, Colorado. To learn more, please visit www.ConstantContact.com or call 781-472-8100.

Constant Contact and the Constant Contact Logo are registered trademarks of Constant Contact, Inc. All Constant Contact product names and other brand names mentioned herein are trademarks or registered trademarks of Constant Contact, Inc. All other company and product names may be trademarks or service marks of their respective owners.

  • Share/Save/Bookmark

Using sIFR for rich flash text without affecting SEO

Posted on August 7th, 2009 by Naveen George

sIFR, an abbreviation for Scalable Inman Flash Replacement with current version 3.0 is a combination of JavaScript and flash, allows you to dynamically view text, especially headings, using flash. This can improve your website’s look dramatically, because it will look the same in every browser and is much smoother than basic HTML text. For example, if you take a look at <h2></h2> tag in IE6, you will notice the pixels isn’t very smooth while in IE7, they look smooth and nice. But that’s not what sIFR can do for you. It allows you to display a more detailed rendered text in any browser. However, there are a few minor points about sIFR:

• Websites must have flash installed and enabled.
• Titles will not work on many mobile devices such as PDAs and mobile phones.
• Websites can become a bit slower.

The sIFR zip file contains flash, JavaScript and CSS files. The basic files you need are:

• css/sIFR-print.css
• css/sIFR-screen.css
• js/sifr.js
• js/sifr-config.js
• flash/sifr.fla

Before uploading everything, one first needs to edit the flash file (sifr.fla) in flash folder using Adobe Flash.

siFR Setup in Flash

Fig. 1

You’ll begin with simply a white box (refer Fig. 1). This is because the flash file is divided into layers. In order to change the font family of the sIFR you are going to use on your website, you have to double click in the white box and the text will show “Bold Italic Normal” (refer Fig. 2).

Fig. 2

Now click the text line to go into the text edit mode (refer Fig. 3). The default font is Verdana. You can use the font chooser to pick your desired font, for example, choose Tahoma.


Fig. 3

NB: Please note that you do not need to change any other options, font size, color and other text styling options can be changed using the JavaScript included in sIFR zip file.

Now we need to compile it to a .swf in order to display flash on your website.

In order to make sIFR work, you need to upload the needed files (i.e., sIFR-print.css, sIFR-screen.css, sifr.js, sifr-config.js and sifr.swf) to your website’s respective directories. After uploading, one has to include the following JavaScript and CSS files between the <head></head> tag as follows:

<link rel="stylesheet" href="styles/sIFR-screen.css" type="text/css" media="screen">
<link rel="stylesheet" href="styles/sIFR-print.css" type="text/css" media="print">
<script src="includes/sifr.js" type="text/javascript"></script>
<script src="includes/sifr-config.js" type="text/javascript"></script>

Finally, before sIFR will replace defined text with flash, it needs to be configured. The configuration takes place in the sifr-config.js file.

After configuring, the sifr-config.js should look like:

var tahoma = {
    src: 'flash/sifr.swf'
};

sIFR.activate(tahoma);

sIFR.replace(tahoma, {
     selector: 'h2'
    ,css: [
         'a { color: #333333; }'
          ,'a:link { color: #333333; }'
         ,'a:hover { color: #0066CC; }'
     ]
});

Don’t forget the “,” otherwise the CSS will not apply or sIFR might stop working. Another important thing is that you have to write the color hexadecimal codes completely!

  • Share/Save/Bookmark

Getting started with JQuery

Posted on July 9th, 2009 by sheeja.a

For working with jquery we need to download the jquery.js file.Also need to add the following javascript code in our file.

The first thing that most Javascript programmers end up doing is adding some code to their program, similar to this:

 window.onload = function(){ alert("welcome"); }

instead of above code, jQuery has a simple statement that checks the document and waits until it’s ready to be manipulated, known as the ready event:

$(document).ready(function(){
   // Your code here
});

Inside the ready event, add a click handler to the link:

$(document).ready(function(){
   $("a").click(function(event){
     alert("Welcome to cabot blog!");
   });
 });

Adding and Removing a CSS Class

To add and remove a class we can use jquery. For example, if we have a class like below

<style type="text/css">
   a.boldtext { font-weight: bold; }
</style>

If we want to add a class to the anchor tag below

<a href="http://jquery.com/">jQuery</a>

we can add it as :

$("a").addClass("boldtext");

Also to remove a class:

$("a").removeClass("boldtext");

we can add a css to a div or a tag using jquery as specified below

$("a").css({backgroundColor: 'yellow', fontWeight: 'bolder'});

Special Effects Using jquery

To add a special effect when we click on the anchor tag we can write code as

 
$("a").click(function(event){
   event.preventDefault();
   $(this).hide("slow");
 });

Now, if you click any link, it should make itself slowly disappear.

Jquery Events

We can create a new jquery event using the code specified below

var e = new jQuery.Event("click");

Describes the nature of the event. This returns a string.

$("a").click(function(event) {
  alert(event.type);
});

result:click

event.pageX/Y

The pageX/Y property pair returns the mouse coordinates relative to the document.The return value is string.

$("a").click(function(event) {
  alert("Current mouse position: " + event.pageX + ", " + event.pageY );
});

Result:”Current mouse position: 130, 640″

event.result

Will contain the last value returned by an event handler . The return value can be anything

$("p").click(function(event) {
 return "hey"
});
$("p").click(function(event) {
 alert( event.result );
});

Result:”hey”
There are several predefined methods in jquery.Some of them are:

event.preventDefault()

Prevents the browser from executing the default action. Use the method isDefaultPrevented to know whether this method was ever called (on that event object).
Stops the browser from changing the page to the href of any anchors.

$("a").click(function(event){
 event.preventDefault();
 // do something
});
event.isDefaultPrevented()

Returns whether event.preventDefault() was ever called on this event object. This returns true/false

$("a").click(function(event){
 alert( event.isDefaultPrevented() );
 event.preventDefault();
 alert( event.isDefaultPrevented() );
});

bind(type,[data],fn )

Binds a handler to one or more events (like click) for each matched element. Can also bind custom events.

Possible event values: blur, focus, load, resize, scroll, unload, beforeunload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error

For example

$("p").bind("click", function(e){
 var str = "( " + e.pageX + ", " + e.pageY + " )";
 $("span").text("Click happened! " + str);
});
$("p").bind("dblclick", function(){
 $("span").text("Double-click happened in " + this.tagName);
});
$("p").bind("mouseenter mouseleave", function(e){
 $(this).toggleClass("over");

});

here object 'p' is binded to different events like  click, dblclick, mouseenter mouseleave etc.

  • Share/Save/Bookmark

Authenticate your website using Facebook Connect API

Posted on June 15th, 2009 by Mujeeb Rahman

Facebook connect API allows users to dynamically connect their identity information from Facebook, such as basic profile, friends, photos information and more, to third party websites, as well as desktop and mobile applications.  The article here describes how to provide Facebook Connect authentication for your web application.

Steps to connect your site to Facebook :

1. If you don’t already have a Facebook API key for your site, create an application with the Facebook Developer application.

  • Go to http://www.facebook.com/developers/createapp.php to create a new application.
  • Enter a name for your application in the Application Name field.
  • Accept the Developer Terms of Service, then click Save Changes.
  • If you have a Facebook API key,follow from next step

  • On the Basic tab, keep all of the defaults.
  • Take note of the API Key, you’ll need this shortly.
  • Click the Connect tab. Set Connect URL to the top-level directory of the site which will be implementing Facebook Connect. You can include a logo that appears on the Facebook Connect dialog. Next to Facebook Connect Logo, click Change your Facebook Connect logo and browse to an image file. The logo can be up to 99 pixels wide by 22 pixels tall, and must be in JPG, GIF, or PNG format.
  • If your site is going to implement Facebook Connect across a number of subdomains of your site , you need to enter a Base Domain
  • Click Save Changes.

2. Create a cross-domain communication channel file called xd_receiver.htm and place it in a directory relative to the Connect URL that you entered in the previous step. Include following script into this file.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.js" type="text/javascript">
</script>
</body>
</html>

3. Next, in your Home Page ,ie page of facebook connect page,Place Html tag as following

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">

4. include following javascript file with in your body tag NOTE IN HEAD TAG

<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>

5. Place facebook login Button in your page

<fb:login-button></fb:login-button>

6. Finally, Include following script after the login button

<script type="text/javascript"> FB.init("YOUR_API_KEY_HERE", "<path from web root>/xd_receiver.htm"); </script>

You should now be able to click on the facebook connect logo and use your facebook credentials to login to your web site.

  • Share/Save/Bookmark

Generating a Google Sitemap via PHP

Posted on June 15th, 2009 by Mahesh Murali

A sitemap is  an XML file,that lists the URLs of a site.  The sitemap file can be used to inform search engines like google on the pages available on a site and when those pages have been modified.  The search engines require a particular format for the sitemap xml file. Let me give a brief on sitemap creation for google.

Create an xml file(say sitemap.xml). Its better to create the xml file dynamically using the scripting language like php, jsp etc.

Format of sitemap xml  accepted by google:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">
<url>
<loc>http://domain.tld/</loc>
<lastmod>2008-01-01</lastmod>
<changefreq>daily</changefreq>
<priority>0.1</priority>
</url>
</urlset>

The points to be remembered when creating a sitemap are:

1. Sitemap should start with the tag <urlset> and end with </urlset>
2. Each set of xml entry shouild start with <url> and end with </url>
3. <loc></loc> contains the url
4. The <lastmod> tag expects a date in the  format YYYY-MM-DD,  or the date format can be in w3c format.
5. The <changefreq> tag expects one of the  values: always, hourly, daily, weekly, monthly etc.
6. The <priority> can be a value between 1.0 and 10

7. Replace special charecters from xml file.
Character                   Replacement
Ampersand     &         &amp;
Single Quote    ‘         &apos;
Double Quote  “         &quot;
Greater Than   >        &gt;
Less Than       <        &lt;

8. Encoding should be UTF-8 mode
9. The maximum permitted size of a sitemap file is 10 MB.

Sample PHP  code for sitemap generation:

$xml = '';
$xml =  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"."\n";
$xml .= "<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"."\n";
for($i=0;$i<$subLimit;$i++){
$title = str_replace("&","&amp;",strip_tags($response['title']));
$loc = str_replace("&","&amp;",strip_tags($response['location']));
$com = str_replace("&","&amp;",strip_tags($response['company']));
//$loc1 = $row['job_jobs_location'];
$title = htmlentities($title, ENT_QUOTES, "UTF-8");
$com = htmlentities($com, ENT_QUOTES, "UTF-8");
$loc = htmlentities($loc, ENT_QUOTES, "UTF-8");
$date = $response['date'];
$date = strtotime($date);
$date = date(DATE_W3C, $date);   //Date in w3c format
$xml .= "<url>"."\n";
$xml .= "<loc>http://www.jobtreks.com/jobresult/$title/$com/$loc/$id</loc>"."\n";
$xml .= "<lastmod>$date</lastmod>"."\n";
$xml .= "<priority>0.50</priority>"."\n";
$xml .= "<changefreq>weekly</changefreq>"."\n";
$xml .= "</url>"."\n";}
$xml .= "</urlset>";
$fh = fopen('sitemap.xml', 'w'); //After exceuting this file, an xml file called sitemap.xml is created.
  • Share/Save/Bookmark

Programming With Twitter API

Posted on June 5th, 2009 by Mujeeb Rahman

Twitter is a popular social networking service where users can share their updates. User updates known as tweets which are text based posts up to 140 characters, displayed on the user’s profile page and delivered to other users who have subscribed to them called followers. Twitter has gained significant attention from web savvy social networkers, and lately also being used by businesses for marketing.

Twitter provides API that allows developers integrate twitter functions on their sites. Using the API, developers are now able to build desktop and web based messaging applications. These APIs have allowed for hundreds of exciting applications to be made available that allows friends to keep in constant contact.

The Twitter API currently consists of two discrete APIs, REST and Search APIs. We are not allowed to make unlimited calls in this API. The API is entirely HTTP-based. Methods to retrieve data from the Twitter API require a GET request. Methods that submit, change, or destroy data require a POST. A DELETE request is also accepted for methods that destroy data. API Methods that require a particular HTTP method will return an error if you do not make your request with the correct method. The API presently supports XML, JSON, and the RSS and Atom syndication formats, with some methods only accepting a subset of these formats.

Some of Search API Methods are shown below:
search: Returns tweets that match a specified query.
URL: http://search.twitter.com/search.format
Formats:json,atom  Example:http://search.twitter.com/search.atom?q=devo&rpp=15
Here rpp is the records per page
Trends: trends:Returns the top ten topics that are currently trending on  Twitter.
URL: http://search.twitter.com/trends.format
Format: json
We can fetch current topics,daily topics or weekly topics.
Example:http://search.twitter.com/trends/daily.json?date=2009-03-19

Some of REST API Methods shown below:

statuses/public_timeline : Returns the 20 most recent statuses from  non-protected users who have set a custom user icon
URL: http://twitter.com/statuses/public_timeline.format
Formats: xml, json, rss, atom.
Example: http://twitter.com/statuses/public_timeline.xml
 statuses/friends_timeline:Returns the 20 most recent statuses posted  by the authenticating user and that user's friends.
URL: http://twitter.com/statuses/friends_timeline.format
Formats: xml, json, rss, atom
Example:http://twitter.com/statuses/friends_timeline.xml
Status Methods:Returns a single status, specified by the id  parameter below.
URL:http://twitter.com/statuses/show/id.format
Formats: xml, json, rss, atom
Example: http://twitter.com/statuses/show/123.xml
  • Share/Save/Bookmark

Cabot selected as best Web Developers on oDesk for May 2009

Posted on June 2nd, 2009 by Shibu Basheer

Cabot Solutions, team member Mujeeb Rahman was selected best web developer on Odesk for May 2009.

We even got a badge to prove it!

best freelance web developers

Congratulations Mujeeb on this achievement, and thanks to our clients for their continued support.

  • Share/Save/Bookmark

java.lang.OutOfMemoryError when indexing large databases in Solr

Posted on May 16th, 2009 by Shibu Basheer

When indexing large databases in Solr, if you encouter java.lang.OutOfMemoryError, this could be caused due to a bug in the mysql jdbc driver.  To resolve this, add include batchSize=”-1″ parameter in your dataSource entry of you data-import.xml file.  The entry should look something like :

<dataSource type="JdbcDataSource" name="ds-2"
          driver="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:8889/mysqldatabase" batchSize="-1"
          user="root" password="root"/>

Reference:

http://wiki.apache.org/solr/DataImportHandlerFaq#head-346bc6622c328a146d1691bc4ed6deb51086d9b3
  • Share/Save/Bookmark

Using Solr / Lucene for full text search with MySQL DB

Posted on May 14th, 2009 by Shibu Basheer

Solr is a standalone webservice application that can be installed on any servlet container like tomcat, jetty etc.  It uses the popular Lucene java library to provide enterprise level search results from databases, filesystem, web services etc.    Solr runs as a web service, so in effect it provides a cross platform search engine.  The results can be accessed from php, java, RoR or .NET by invoking its web service.  The only requirement on your server is that it should allow you to run java application or have deploy solr as a webapp in an existing servlet container such as tomcat or jetty.

This article shows how to get Solr index and provide search results for a simple MySQL table.  The search results will be provided in XML, so you can get your web application to read the results, parse it and display it any form desired. Read the rest of this entry »

  • Share/Save/Bookmark