Archivio

Posts Tagged ‘Google’

Google lancia un suo servizio per URL brevi

15 dicembre 2009 zaragon Nessun commento

Abbiamo imparato a conoscere ed apprezzare i servizi di URL brevi grazie all’ utilizzo di Twitter. Uno tra i più famosi è certamente http://bit.ly/ ma Google non vuole essere da meno e ha creato un servizio tutto suo: Google URL Shortener.

Prosegui la lettura…

Google Nexus One: l’ ennesimo anti-iPhone

14 dicembre 2009 zaragon Nessun commento

Ce lo aspettavamo ormai da tempo; Big G non poteva attendere oltre ed eccolo qua:

Prosegui la lettura…

Google Closure Compiler in C#

9 novembre 2009 zaragon Nessun commento

Mads Kristensen has created a C# class for using Google Closure Compiler.

This class is very easy but very useful:

public string Compress(string file)
{
  string source = File.ReadAllText(file);
  XmlDocument xml = CallApi(source);
  return xml.SelectSingleNode("//compiledCode").InnerText;
}

private static XmlDocument CallApi(string source)
{
  using (WebClient client = new WebClient())
  {
    client.Headers.Add("content-type", "application/x-www-form-urlencoded");
    string data = string.Format(PostData, HttpUtility.UrlEncode(source));
    string result = client.UploadString(ApiEndpoint, data);

    XmlDocument doc = new XmlDocument();
    doc.LoadXml(result);
    return doc;
  }
}

For information and for download the complite code, read Mads Kristensen’ s post.

Abount Closure Compiler project.

Categorie:C#, Google Tag: , ,