Post Tagged with: "google"

Speed up browsing with faster DNS resolution using namebench

Speed up browsing with faster DNS resolution using namebench

In December 2009, Google publicized their new public DNS resolution service; a week later, they also announced the open-source release of a DNS benchmarking tool called namebench, a DNS benchmarking tool. It is designed to "hunt down the fastest DNS servers available for your computer to use."

Since web traffic is measured in milliseconds, delays of 200-400ms for slow DNS resolution can be more meaningful than it would seem. Using namebench to benchmark a variety of DNS servers, it is possible to speed up browsing by finding a faster DNS resolver.

You could write a script to test DNS resolution via nslookup, or a similar query tool; however, namebench includes several interesting features: it uses your browser history to select a list of hosts to test against, appropriately handles multiple IPs of cache-sharing resolvers, and reports on resolvers that use DNS hijacking. At the end of its benchmarking process, namebench suggests which DNS resolver seems to be the fastest, and displays useful statistical information about the test results.

March 1, 2010 0 comments Read More
CompleteFusion Visitor Statistics

CompleteFusion Visitor Statistics

Its often useful to know which browsers, screen resolutions, operating systems, etc. are most frequently used by your site's visitors. I was recently looking through Google Analytics reports for CompleteFusion, and thought it would be interesting to share the results.

To be able to draw some conclusions on browser and operating system popularity over time, I compared visitor traffic from two time periods: April 10, 2008 to December 31, 2008 and January 1, 2009 to September 23, 2009.

Browsers
Firefox: 61.95% -> 61.40% (-0.55%)
Internet Explorer: 30.61% -> 25.06% (-5.55%)
Chrome: 0.93% -> 5.69% (+4.76%)
Safari: 3.65% -> 4.74% (+1.09%)
Opera: 2.19% -> 2.13% (-0.06%)
Other: 0.67% -> 0.98% (+0.31%)

Operating Systems
Windows: 80.74% -> 67.08% (-13.66%)
Linux: 11.49% -> 22.87% (+11.38%)
Mac: 7.44% -> 8.92% (+1.48%)
iPhone: 0.07% -> 0.47% (+0.40%)
Other: 0.26% -> 0.66% (+0.40%)

Browsers and Operating Systems
Firefox / Windows: 46.88% -> 34.57% (-12.31%)
Internet Explorer / Windows: 30.61% -> 25.04% (-5.55%)
Firefox / Linux: 10.89% -> 21.55% (+10.66%)
Chrome / Windows: 0.93% -> 5.60% (+4.67%)
Firefox / Mac: 3.78% -> 4.87% (+1.09%)
Safari / Mac: 3.38% -> 3.86% (+0.48%)
Opera / Windows: 1.86% -> 1.46% (-0.40%)
Opera / Linux: 0.13% -> 0.65% (+0.52%)
Other: 1.54% -> 2.40% (+0.86%)

Screen Resolution
1280×1024: 21.98% -> 20.24% (-1.74%)
1280×800: 14.48% -> 16.73% (+2.25%)
1024×768: 17.00% -> 14.32% (-2.68%)
1680×1050: 18.06% -> 13.76% (-4.03%)
1440×900: 8.17% -> 9.76% (+1.59%)
1920×1200: 4.91% -> 7.26% (+2.35%)
1600×1200: 4.18% -> 3.22% (-0.96%)
1400×1050: 3.59% -> 2.47% (-1.12%)
1024×600: 0.46% -> 2.22% (+1.76%)
1152×864: 1.20% -> 1.74% (+0.54%)
Other: 5.97% -> 8.28% (+2.31%)

Java Support
Yes: 90.97% -> 83.55% (-7.42%)
No: 9.03% -> 16.45% (+7.42%)

Firefox and Internet Explorer, the mainstays of the browser market, both lost market share over the time period. The explosive increase in Chrome usage seems to show that Google has entered a real contender in the browser wars. Previously, Chrome was behind Safari and Opera in usage, and now it is solidly third in popularity among CompleteFusion visitors. It will be interesting to see if Chrome's growth continues or stagnates in the future.

1280×1024 has been a popular, fairly standard 4:3 resolution for quite a while, although it seems that widescreen (16:9) displays are becoming more popular since 1200×800 usage has grown (and surpassed 1024×768). Interestingly, there seems to be growth at the high end (1900×1200) and lower end (1200×800), but virtually nothing in between.

Also, I initially would have expected Java support to have grown over time, but Java support among CompleteFusion visitors has fallen by 7.42%. I'm not sure why, since an obvious correlation to browser usage doesn't seem to exist, but I suspect the main reason is that mobile browsers that lack Java support have become more popular. Additionally, it could be that people who have recently switched to Chrome, Firefox, or an upgraded version of Internet Explorer haven't installed the Java plugin for their current browser yet.

September 23, 2009 0 comments Read More
Use Google Translate from the command-line with resty

Use Google Translate from the command-line with resty

As I mentioned in my last post (Access Google Translate API with PHP), it is fairly trivial to access the Google Translate API using PHP. I recently came across Micha Niskin's resty, a simple commandline tool to make REST requests, and decided to see how easy it would be to use with the Google Translate API.

Ultimately, it wasn't hard at all to use resty to run translations through the Google API. First, I had to download resty, which can be done as follows:

curl http://github.com/micha/resty/raw/master/resty > resty

Then I set the REST host:

resty http://ajax.googleapis.com/ajax/services/language

And created my GET request:

resty GET '/translate?v=1.0&langpair=en%7Ces&q=Test'

Finally, the response from Google:

{"responseData": {"translatedText":"Prueba"}, "responseDetails": null, "responseStatus": 200}

To include a referrer URL (which Google requires when you use the Translate API), just add the curl -e parameter with the referrer URL:

resty GET '/foo' -e http://blah
May 23, 2009 0 comments Read More
Access Google Translate API with PHP

Access Google Translate API with PHP

Recently I wanted to utilize Google's translation API, so I came up with the following PHP script. Please note that I didn't build in any error handling, debugging code, security measures, or the full range of features of the Google translation API.. all of which you should probably do if you're going to use this in a public or production environment.

Create a new .php file on your web server, as follows:

  1. // Basic request parameters:
  2. // s = source language
  3. // d = destination language
  4. // q = Text to be translated
  5.  
  6. $s = $_REQUEST['s'];
  7. $d = $_REQUEST['d'];
  8. $lang_pair = urlencode($s.'|'.$d);
  9. $q = urlencode($_REQUEST['q']);
  10.  
  11. // Google's API translator URL
  12. $url = "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=".$q."&langpair=".$lang_pair;
  13.  
  14. // Make sure to set CURLOPT_REFERER because Google doesn't like if you leave the referrer out
  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_URL, $url);
  17. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  18. curl_setopt($ch, CURLOPT_REFERER, "http://www.yoursite.com/translate.php");
  19. $body = curl_exec($ch);
  20. curl_close($ch);
  21.  
  22. $json = json_decode($body, true);
  23. echo $json['responseData']['translatedText'];

Then just load up http://www.yoursite.com/translate.php?s=en&d=es&q=Test and you should see "Prueba" (Spanish for "Test").

May 19, 2009 8 comments Read More