Open Graph Protocol

Last update : June 29, 2013

Open Graph Protocol Logo

The Open Graph protocol enables any web page to become a rich object in a social graph. For instance, this is used on Facebook to enable any web page to have the same functionality as a Facebook Page.

While many different technologies and schemas exist and could be combined together, there isn’t a single technology which provides enough information to richly represent any web page within the social graph. The Open Graph protocol builds on these existing technologies and gives developers one thing to implement.

To turn a web page into a graph object, you need to add basic metadata to the page. The initial version of the protocol is based on RDFa (Resource Description Framework – in – attributes,  W3C Recommendation), which means that you’ll place additional < meta>-tags in the <head> of your the page.

The Open Graph protocol was originally created at Facebook and is inspired by Dublin Core, link-rel canonical, Microformats, and RDFa. It is related to the semantic web.

DNS Diagnose Tools

There are a lot of online and desktop tools available to manage DNS and diagnose DNS problems.

My favorite online tool is network-tools.com, a website operated since 1998 by The Keyword Factory of Ocean City, NJ.

This site offers the following diagnose results for a given  url :

  • Ping
  • Lookup
  • Trace
  • Whois (IDN Conversion Tool)
  • DNS Records (Advanced Tool)
  • Network Lookup
  • Spam Blacklist Check
  • URL Decode
  • URL Encode
  • HTTP Headers  [SSL]
  • Email Verification

An express diagnose method to obtain all relevant informations with one test is also available.

An example of the results from retrieving DNS records for www.html5.lu is given hereafter :

DNS servers
ns1.dns-stock.com
ns2.dns-stock.com

Answer records
html5.lu MX
preference: 10
exchange: venus.vo.lu
3600s
html5.lu NS ns2.dns-stock.com 3600s
html5.lu NS ns1.dns-stock.com 3600s
html5.lu SOA
server: ns1.dns-stock.com
email: sysop@vo.lu
serial: 2010082701
refresh: 28000
retry: 2800
expire: 2419200
minimum ttl: 3600
3600s
html5.lu A 85.93.210.131 3600s

Authority records

Additional records
venus.vo.lu A 80.90.45.96 28800s
venus.vo.lu A 80.90.45.97 28800s

Facebook Javascript API

The new Facebook Javascript API handles the following methods :

Core methods

  • FB.init : Initializes the library
  • FB.login : Login/Authorize/Permissions
  • FB.logout : Logout the user in the background
  • FB.api : Make a API call to the Graph API
  • FB.ui : Method for triggering UI interaction with Facebook as iframe dialogs or popups, like publishing to the stream, sharing links
  • FB.getLoginStatus : Find out the current status from the server, and get a session if the user is connected
  • FB.getSession : Synchronous accessor for the current Session (less overhead as the asynchronous access)

Data Access Utilities

  • FB.Data.query : Performs a parameterized FQL query and returns a FB.Data.query object which can be waited on for the asynchronously fetched data
  • FB.Data.waitOn : Wait until the results of all queries are ready

Event Handling

XFBML methods

Canvas methods

Some useful tutorials about the new Facebook Javascript SDK are listed hereafter :

  • Mahmud Ahsan on Thinkdiff.net: Graph api & javascript base Facebook Connect tutorial
  • Abu Ashraf Masnun on masnun.com : Using The Facebook Graph API with js-sdk : An explanatory Tutorial
  • timware on Hyperarts : How to Add Facebook’s XFBML Like Button & Social Plugins to Your Web Pages & WordPress Posts

A very useful development tool is the Test Console made available by Facebook.

IYOUIT – Share Life Blog Play

IYOUIT gathers data around users and about users. This data is called context. Context is centered on places user visit and people they meet and can grow to include all kinds of things that surround users.

IYOUIT is a mobile application developed in Python, and running on Nokia Series 60 phones. Its aim is to make it easy for an end-user to automatically record, store, and use context information, e.g. for personalization purposes, as input parameter to information services, or to share with family, friends, colleagues or other relations, or just to log them for future use or to perform statistics on their own life.

Personal context : Location – Place – Experience – Photo – Sound – Observation – Books and Products – Weather – Marker

ipconfig /release /renew

screenshot ipconfig

Sous Windows, la commande Ipconfig affiche toutes les valeurs actuelles de la configuration du réseau TCP/IP et actualise les paramètres DHCP (Dynamic Host Configuration Protocol) et DNS (Domain Name System). Utilisé sans paramètres, ipconfig affiche l’adresse IP, le masque de sous-réseau et la passerelle par défaut de toutes les cartes.

ipconfig /release
Envoie un message DHCPRELEASE au serveur DHCP pour libérer la configuration DHCP actuelle et annuler la configuration d’adresse IP de toutes les cartes ou d’une carte spécifique si le paramètre Carte est inclus.

ipconfig /renew
Renouvelle la configuration DHCP de tous les cartes (si aucune carte n’est spécifiée) ou d’une carte spécifique si le paramètre Carte est inclus.

Les commandes sont entrées dans la fenêtre Command Prompt de Windows. Le recours à ces commandes est notamment nécessaire sous Windows Vista pour configurer un lapin Nabaztag si on n’arrive pas à se connecter sur l’adresse IP 192.168.0.1. Comme indiqué sur les pages help de Nabaztag, la séquence de commandes

ipconfig  /release
ipconfig  /renew

règle le problème.

Playlist formats : m3u, pls, xspf and others

Last update : June 16, 2012;
M3U is a file format to store multimedia playlists. It was first used by Winamp. PLS does the same, but is a more expressive format than basic M3U, as it can store  information on the song title and length (this is supported in extended M3U only). With PLS version 2, playlists also include a PLS version declaration.

iTunes, QuickTime Player, Real player, Winamp, XBMC, XMPlay, VLC media player and many other programs play PLS files without any extra codecs.

Xiph.Org Foundation, a non-profit organization that produces free multimedia formats and software tools, created in 2004 the XML Shareable Playlist Format (XSPF, called spiff) for sharing the kind of playlist that can be played on every personal computer or portable device. The home of XSPF is the website xspf.org.

XSPF is supported by the DLNA server Seviio. The playlists handle not only audio, but also video or other multimedia files.

Google Text-to-Speech (TTS) support

Last update : 30 April 2011

On november 16th, 2009, Google announced on their official blog that english text-to-speech was added to the translation tools.  Google used eSpeak, which is an open source software speech synthesizer for this service.

In may 2010,  Google Translate added more audio translations languages, including Afrikaans, Albanian, Catalan, Chinese (Mandarin), Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Haitian Creole, Hindi, Hungarian, Icelandic, Indonesian, Italian, Latvian, Macedonian, Norwegian, Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Spanish, Swahili, Swedish, Turkish, Vietnamese and Welsh.

The speech audio is in MP3 format and is queried via a simple HTTP GET (REST) request. For english, an example url is:

http://translate.google.com/translate_tts?tl=en&q=how are you?

The TTS web service is restricting the text to 100 characters and the service returns 404 (Not Found) if the request includes a Referer header.

December 3, 2010, Google acquired Phonetic Arts, a company specialised in speech synthesis. Phonetic Arts Limited delivers technology that generates natural expressive speech. The products include Phonetic Morpher,  Phonetic LipSync  and Phonetic Synthesizer. Phonetic Arts, formerly known as Tayvin 356 Limited, was founded in 2006 and is based in Cambridge, UK.  The Phonetic Arts technology generates natural computer speech from small samples of recorded voice and should improve the voice output quality of Googles text-to-speech applications.

Google does not only provide speech output tools, but also speech input tools (Voice Search, Voice Input, Voice Actions), mainly in relation with the mobile phone OS Android.

Version 11 of the Google Chrome browser includes the HTML5 Speech Input API.

An amusing application of the Google TTS system is the Google Translate Beatbox.

Errror-reporting in php

The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level. Some examples are given hereafter:

// Turn off all error reporting
error_reporting(0);

// Report simple running errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);

PHP-Developers appreciate the 

// Reporting E_NOTICE can be good too (to report uninitialized variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

// Report all PHP errors
error_reporting(E_ALL);

PHP-Developers appreciate SimpleTest, a PHP unit test and web test framework. The most recent version is 1.0.1 released 2008-04-08, available at SourceForge. JAVA-Developers are  familiar with JUnit, originally written by Erich Gamma and Kent Beck. SimpleTest Interfaces are similar to JUnit.