Author Archives: Jawad Shuaib

Adding a Glossary to Improve SEO


A page containing industry relevant keywords does wonders for Search Engine Optimization as it improves the overall keyword density. It can also help index your website in the Google Dictionary. For that reason, I needed a glossary page for one of my websites. Most web developers will simply hard code the glossary using HTML. This works fine for small lists of keywords, but a more scalable solution is needed for larger sets of glossary terms. I couldn’t find a solution on the web so I coded a simple PHP script to do just that.

The following piece of code can be used to dynamically generate an ordered list of glossary terms. The developer can add additional items to the array (or pull it from a database) instead of hard coding the HTML – that should help save time and keep things clean.

PHP Script

The original idea for this was inspired by Urban Dictionary.

Here is a demo. You are welcome to use the code however you like.

Extracting Latitude and Longitude Coordinates of an Address

It is 6 AM – I will be hitting the hay shortly after sunrise as I finish coding a new component for my CRM. Part of the system required me to geocode an address before storing it in the database. Geocoding refers to extracting the latitude and longitude coordinates of a specified location. During my research, I found some amazing open datasets to help build such a system. However, I eventually sided with using Google’s enormous database of geocoded locations because I assume it is the most up-to-date.

So I ended up coding the following PHP script to extract the lat and lng coordinates of addresses submitted by the user. The script uses jQuery to send an AJAX request for a JSON output after querying the XML API for Google Maps.

I know this script would be useful for others so I am making it available to everyone. To use this code in your own projects, simply change the Google Maps API key found on line 10.

Use the following link to Download the Full Code. Have fun!

Brain Wall: Web 2.0 Post-it Notes

I have been having a lil’ too much fun building back-end applications lately. One tool I felt would be particularly useful is the incorporation of “Post-it notes” on individual pages within a Content Management System (CMS) – this would allow employees to leave messages and reminders for themselves or others in the organization. Got a customer complain that you would rather procrastinate on? Stick a Post-it note on it!

Then a neuron misfired in my head: it would be pretty neat if there was a crowd sourced implementation of virtual sticky posts…an app that would let random people post random thoughts on a webpage. So I ended up pulling an all-nighter to build Brain Wall – stick your thoughts.

Brain Wall

I came across a neat startup, BubbleShout, that uses a similar concept. Brain Wall app could have other uses, such as in conferences or weddings to prompt interactions from attendees, etc. Or maybe there is no practical use. Maybe I am just dehydrated and sleep talking. I should go to bed, have fun!

Anatomy of a Simple Search Engine

Google receives more than 100 million search requests each day. It is the job of a Search Engine to fetch, sort, and rank the appropriate results for each query from its dataset of several billion web pages. It goes without saying that this is a tremendously complex task – but essentially all search engines are composed of four attributes:

1. Crawling for new content.
2. Storing the content once it is found.
3. Applying algorithms to the content to glean off useful data.
4. Making the content searchable.

It is possible to build a simple search engine of your own. I have written a simple script in PHP to crawl, store, and search the content. Use the code in the following links to get started:

1. Code for how to build a crawler that stores data in an index using MySQL. (example)
2. Code for searching the data once it has been stored in the index. (example)

PHP code for Search Engines

Powerful Search Engines need to process tremendous amounts of data – this is often accomplished using programming environments such as C and Python. If you’re interested in learning more about building crawlers and writing sorting algorithms, I suggest you read Programming Collective Intelligence: Building Smart Web 2.0 Applications and Webbots, Spiders, and Screen Scrapers: A Guide to Developing Internet Agents with PHP/CURL.

Search Engine Optimization Course – Spring 2011

Many marketers are interested in organically growing traffic to their websites. It is the most cost efficient and scalable strategy for both small and large businesses. Search Engine Optimization (SEO) is an area of study that looks at present developments in the Search Engine Marketing (SEM) space to optimize website content for traffic and user retention.

I have been teaching a course in Search Engine Optimization at Humber College for the past 2 years. The course introduces students to best practices in SEO; such as, HTML optimization, meta tagging, server directives, SE submission, content targeting, traffic analytics, website engagement, conversions, content distribution, social media, keyword analysis, A/B variant testing, online advertising, geo targeting, etc. The course is primarily geared towards career oriented individuals involved in promoting businesses or marketing online properties.

The course begins on March 1st, 2011.

400 Words to Inspiration

I dream my painting, and then I paint my dream. – Vincent Van Gogh

Richard Dawkins is one of the most interesting people of our times – and he had this to say about life: We are all going to die, and that makes us the lucky ones. Most people are never going to die because they are never going to be born. The potential people who could have been here in my place but who will in fact never see the light of day outnumber the sand grains of Sahara. Certainly those unborn ghosts include greater poets than Keats, scientists greater than Newton. We know this because the set of possible people allowed by our DNA so massively outnumbers the set of actual people. In the teeth of these stupefying odds it is you and I, in our ordinariness, that are here!

We all had some crazy ideas and dreams when we were kids. When people asked – “What do you want to do when you grow up?” you didn’t say “I want to play safe and be an executive for a Fortune 100 company” or “I want to work for the government for the job security”? You wanted to do something that excited you, that you were passionate about – “Air Force, Astronaut, Sports, Artist, Miss World” etc. You didn’t even think if that would get you enough money. You just wanted to do it.

As Tony Robbins put it, “The only thing that’s keeping you from getting what you want is the story you keep telling yourself about why you can’t have it.

As is often the case, the most uncomfortable thing to do is the one that people need to act on the soonest.

Failing is not scary. What’s scary is that you are 60 and reflecting back on your life “May be I should’ve given my dreams a chance, maybe I would’ve succeeded, maybe I would’ve lived my dream” If you wait until it’s obvious, it’s already too late. You have missed the boat.

Take a minute to contemplate this: What would you be doing right now if you had no risk of failing?

I don’t know any answers, but I know that the most important investment you can make is in yourself.  As someone wise correctly remarked, once you’re on the right path, all you have to do is keep walking.

I made a big decision today to begin a new chapter in my life. Wish me luck.

Emerging Technologies and Trends in Social Media

I delivered a workshop to the Directors Guild of Canada (DGC) on Emerging Technologies in Social Media. It was primarily based on an updated version of my previous slideshare presentation at Telefilm. So much has happened in this space since my last workshop. There is great amount of interest in real-time content, cloud computing, and tablet computers.

Some useful insights:

1. Much of the innovation in mobile is driven by the convergence of mobile with social media sites.
2. Search advertising is more effective than display ads because it targets intent.
3. The social graph represents objects in the graph (people, pages, photos, etc) and the connections between them (e.g., friend relationships, shared content, and photo tags).
4. 2011 will be the year of the Tablets. Say goodbye to Netbooks.

View more presentations from jawadshuaib.

Social Media in a Nutshell

I was recently asked to deliver a workshop on Social Media at Telefilm Canada to an audience of Business Analysts. The presentation was designed to cater all aspects of social media technologies; such as, social networking, cloud computing, mobile devices, gaming consoles, marketing, etc. The workshop ran between 9 to 4 pm. The day would have seemed quite long had it not been for the support of Lorraine, from Humber College, and the amazing staff and audience at Telefilm Canada.

Anyway, I hope you enjoy the presentation slideshow of the workshop. I borrowed the first few slides from my earlier presentation, “Web 3.0 – What you may not know about the new web”:

Where is your birthday in Pi?

many digits of pi
In the beginning, there was Pi. And from there the Universe evolved into an infinity of possibilities. Today is the annual Pi day, and it also happens to be Albert Einstein’s birthday. Suffice to say anyone born in the month of March should be proud 😀

Anyway, this year I am celebrating Pi day with the launch of a fun little application that finds your birthday amongst the first 100, 000 digits of this infinitely irrational number.

For the math nerds; the probability of finding any number of length k in a dataset of size N, also known as the Poisson Approximation of Binomial Probabilities, is 1 – 1/e^[N/10^k] x 100%. Which in this case happens to be 63% for a date of birth of length 5 and dataset N of size 100, 000. So if you don’t find your birthday in Pi, it’s because my sample size is relatively small.

Have fun! 🙂

Introducing the Social Quran

A few weeks ago I watched “The Book of Eli“, and was inspired to do something about it. I considered learning braille, but then gave up 5 minutes later.

I decided, instead, to attempt at providing an interactive experience for those who enjoy reading books online. I felt that it would be especially neat if I could extend that experience to religious text books. So here is what I made,

The Social Quran

Essentially, readers are now able to easily share their favourite passages with others on the website, as well as with their friends on other social networks. Here are a few features:

1. Provide search option to lookup any passage in the entire book.
2. Users can log in via Facebook Connect and bookmark their favourite verses.
3. Readers can share the verses with other social media sites (i.e. Facebook, Twitter)
4. A recommendation system provides “recommended” content similar to how Amazon serves suggested books. The more people that use this site, the better it becomes at serving relevant passages.

Here’s a video walk through of the basic functionality,

I deliberately kept the overall design simple in order to minimize distractions. Please note that I cannot personally vouch for the English translation of the Quran. I did my best here, and I hope you find this website useful.