Gregg Hilferding :)


From Google:

We have decided we are no longer willing to continue censoring our results on, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all. We recognize that this may well mean having to shut down, and potentially our offices in China.

It's about time.

Published by Gregg Hilferding on January 12th, 2010 at 7:23 pm. Filed under UncategorizedNo Comments

Micro-lending to change the world

Back in January I helped make a loan to Nosirova Uguljon so that she could buy a greater range of goods for her childrens' clothing business. Nosirova's business is in Kanibadam, Tajikistan. (Tajikistan is the poorest of the former Soviet republics.) Her daughter helps with the business:

Nosirova Uguljon's Daughter

Nosirova Uguljon's Daughter

Entrepreneurs like Nosirova are the key to building the economy in poverty stricken areas like Tajikistan. Plus, her daughter represents a better future for their family and community. Although the total loan amount was $1,200, it only took $25 of my money to help support this business. I was able to join with 37 other lenders to support Nosirova's business through the microfinance site, Kiva.

Alice Indangasi Shabola

Alice Indangasi Shabola

She's already paid back her loan and I've turned around the $25 and loaned it to Alice Indangasi Shabola for her clothing business in Kenya. That $25 now represents $50 of economic impact to businesses in developing countries. When Alice pays back her loan, I'll loan that money out again to yet another business. You can see what kind of long-term effect just $25 can have on Kiva.

Of course, once you've made one loan, you want to make more. :) Here's my lending page on Kiva showing all the loans I've made.

I hope you'll find $25 to loan through Kiva and have a real impact decreasing poverty around the world.

Published by Gregg Hilferding on January 2nd, 2010 at 7:33 pm. Filed under SignalNo Comments

expandUrl passes 11,000 mark (at least)

Since announcing the launch of expandUrl and fixing the few bugs that cropped up in the first week or so, I have barely given the service a second thought. The API works incredibly well for my own sites which take advantage of it.

Today, after receiving a report that the service was unavailable last night, I took another look at it. Still not sure why it went down, but while I was working on it I've added some basic logging (for troubleshooting purposes) and looked around the internet to see if people are using the service.

Since logging was never included in the first place, the only way to surface a reasonable count of URLs was to count the cache files. Since cache files are programatically deleted, I was pretty shocked to find over 11,000 files in that directory. Now that I have actually logging in place, the site displays a counter. Today's count? 11,411 URLs expanded!

Of course, people only know about the service because of the folks who have helped spread the word about it! Thank you to all these folks for mentioning expandUrl:

  • Blog Brasil Academico "If you prefer a cleaner and more free advertising try"
  • Troy Sabin "The Yang to the URL shortener Yin - URL expanders"
  • Free Nuts #2 in their top ten URL expanders list!
  • Borrowed Code Mentioned as part of a blog entry about fighting Twitter spam.
  • Benny Chen "After failing to find a good solution, a short address before the humble beginning to run out to restore the service; Can only say that a group of prescient people, ah!"
  • Kate Morris "There is another useful tool available - - it shows you not only where it goes, but how many times it is redirected and how. :) Not my tool, but a friend built it."

Finally, I discovered a Google Code project that integrates the expandurl API into Google Chrome. This is very cool to me, as it means the service will be used by lots of folks (even if they don't know they're using it!). :)

Not too shabby for 221 days in. ;)

Published by Gregg Hilferding on December 4th, 2009 at 4:27 pm. Filed under Search,Signal,Social Media,WebmasterNo Comments

Hacking Lessn To Track Statistics

When Shaun Inman shared his URL shortening PHP script Lessn, I was pretty excited.

Right now I use, a free service from Raven SEO Tools, for all my URL shortening needs. It's awesome and 99.5% perfect. But I've really wanted to host my own for three reasons:

  1. I want bulk uploads with custom short URLs so I can have predictable, product SKU short URLs.
  2. I want to be able to repoint a short URL if it's old URL changes or 404s.
  3. I don't want to compete with other users for custom URLs.

Unfortunately, rolling my own will mean I miss out on all the amazing coolness of Mine wouldn't be as slick or easy to use. However, Lessn is slick and easy to use. But it doesn't do custom URLs and it doesn't track how often people visit a short URL. So I added those features.

Tracking clicks

In the file /-/db.php, add this statement to create a second table:

mysql_query('CREATE TABLE IF NOT EXISTS `'.DB_PREFIX.'stats` ( '.
'`id` int(11) unsigned NOT NULL auto_increment, '.
'`url_id` int(11) unsigned NOT NULL, '.
'`ts` datetime NOT NULL, '.
'`ua` text character set utf8 collate utf8_unicode_ci NOT NULL, '.
'`ref` text character set utf8 collate utf8_unicode_ci NOT NULL, '.
'`ip` int(4) unsigned NOT NULL, '.
'PRIMARY KEY (`id`), '.
'KEY `url_id` (`url_id`) '.

Then, in the /index.php file, add this line right after the header('Location:'); line:

mysql_query("INSERT INTO `".DB_PREFIX."stats` SET `url_id`='".$row['id']."', `ts`='".date("Y-m-d H:i:s")."', `ua`='".mysql_real_escape_string($_SERVER['HTTP_USER_AGENT'])."', `ref`='".mysql_real_escape_string($_SERVER['HTTP_REFERER'])."', `ip`='".sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']))."' ");

To test, go visit one of your short URLs, and then go check the stats table. You should see a new entry in the table.

Now, how you choose to display the data from this table is up to you. :)

Published by Gregg Hilferding on August 31st, 2009 at 1:31 pm. Filed under PHPNo Comments