Tag Archive for 'api'

Microformats API in Firefox3-Erweiterungen nutzen

Rob Crowther hat für IBM developerWorks eine großartige Anleitung (mit Beispiel-Code) geschrieben, wie man die Microformats API in Firefox3 Extensions nutzen kann.

The upcoming Firefox 3.0 release has built-in support for microformats in the form of an API that you can access from a Firefox extension. In this tip, you follow a simple example of how to use this API from within your extension code. You take a skeleton Hello World extension and give it the ability to store an hCard from any Web page and then use that stored hCard to populate a Web form.

Die Beispiel-Erweiterung von Crowther nutzt hCard-Informationen um ein (im Beispiel beiliegendes) Profil-Formular auszufüllen.

hcardformfiller.jpg

Ablauf: Zuerst auf ne Seite mit hCard, linken Knopf drücken, dann auf das Fromular und rechten Knopf drücken.

hCardFormFiller für WordPress

Um dem Beispiel etwas mehr Nutzen zu geben, habe ich es testweise für das WordPress Kommentarformular umgeschrieben. Die Einzige notwendige Änderung ist, folgenden Code in der overlay.js:

onToolbarButtonPasteCommand: function(e) {
 if (this.uF.fn) {
   content.document.getElementById('name').value = this.uF.fn;
   content.document.getElementById('email').value = this.uF.email[0].value;
   content.document.getElementById('homepage').value = this.uF.url[0];
   content.document.getElementById('address1').value = this.uF.adr[0]['street-address'];
   content.document.getElementById('address2').value = this.uF.adr[0].locality;
   content.document.getElementById('city').value = this.uF.adr[0].region;
   content.document.getElementById('postcode').value = this.uF.adr[0]['postal-code'];
 }
}

durch folgenden Code:

onToolbarButtonPasteCommand: function(e) {
 if (this.uF.fn) {
   content.document.getElementById('author').value = this.uF.fn;
   content.document.getElementById('email').value = this.uF.email[0].value;
   content.document.getElementById('url').value = this.uF.url[0];
 }
}

zu ersetzen und das war’s. Jetzt könnt ihr mit einer hCard bewaffnet losziehen und WordPress Blogs zuspammen :)

Wer das Addon mal ausprobieren möchte kann sich den angepassten hCardFormFiller for WordPress runterladen… den original Code findet man hier.

Nachdem die Microformats kein UI spendiert bekommen haben, gibt es vielleicht demnächst einige Addons die diese Lücke füllen werden.

Interessante Links:

twitter-API mit Location-Support

Seit letzter Woche ist es möglich, das Location-Feld (rechts oben im Profil) über die Twitter-API zu ändern.

Updates the location attribute of the authenticating user, as displayed on the side of their profile and returned in various API methods. Works as either a POST or a GET.

Mal schaun wann es den ersten Twitter-Dienst gibt, der die Location über das L: - nanoformat anpasst, oder wann es eine schöne fireeagle-Anbindung gibt.

(via)

Google Contacts Data API unterstützt OAuth…

Tolle News für die OAuth Community:

We are happy to announce that the Google Contacts Data API now supports OAuth. This is our first step towards OAuth enabling all Google Data APIs.

Mehr dazu in der OAuth Google-Group

(via hackr)

SocialGraph API debugger

Wer den Parser der SocialGraph API einmal testen will, um z.B. zu sehen welche Links einer Seite schon vom Google-Index erfasst wurden, dem bietet Google eine einfache Parser Testing API.

As a testing and debugging aid, the Social Graph API includes an API to run any document against the Social Graph API’s internal parser to see what it would’ve parsed, had Googlebot actually crawled it.

Und für faule Menschen wie mich gibts von Google auch gleich noch ein Greasemonkey script dazu :)

Ich glaube der Schmiermaxe und ich werden noch richtig dicke Freunde!

DataPortability für Desktop-Anwendungen

Anfang Februar habe ich einen interessanten Bericht über “How portable is your Skype data?” von Phil Wolff gelesen. Der Artikel befasst sich mit der Daten-Portabilität von Nicht-Web-Applikationen am Beispiel von Skype. Leider wird diese Art des Datenaustauschs (z.B. zwischen Desktop-Anwendungen und Web-Anwendungen) auch von DataPortability.org noch nicht ausreichend behandelt und es fehlen Formate die diese Art von Austausch ermöglichen (APML mal ausgenommen).

Genau diesen Bericht müssen auch Microsoft und Google gelesen haben bevor beide diesen Monat ihre Contacts-APIs veröffentlichten :)

Nach den Beschreibungen von Google:

  • Import a user’s Google contacts into their web or desktop application
  • Export their application’s contact list to Google
  • Write sync applications for mobile devices or popular, desktop-based contact management applications

…und Microsoft:

To tackle the issue of contact data portability it is important to reconcile the larger issue of data ownership. Who owns the data, like email addresses in a Windows Live Hotmail address book? We firmly believe that we are simply stewards of customers’ data and that customers should be able to choose how they control and share their data. We think customers should be able to share their data in the most safe and secure way possible, but historically this openness has been achieved largely through a mechanism called “screen-scraping,” which unduly puts customers at risk for phishing attacks, identity fraud, and spam. Now with the Windows Live Contacts API, we have provided an alternative to “screen-scraping” that is equally open but unequivocally safer and more secure for customers.

…könnte man fast meinen, dass die Hürde des Datenaustauschs zwischen Desktop-Anwendungen und Web-Anwendungen überwunden wäre.

Nicht ganz… Leider basieren beide Systeme “noch” auf proprietären Webservices und müssen unterschiedlich angesprochen werden, was eine Menge zusätzlichen Entwicklungsaufwand bedeutet. Die wesentlich bessere Lösung wäre natürlich eine einheitliche Contacts-API oder wie Carsten Pötter meint:

Of course, it was great if a more open protocol like OAuth was used, but the announcement might encourage more social networks and other corporations to pursue similar steps.

Immerhin gehören die Social-Network-Anti-Patterns durch diese Entwicklungen hoffentlich bald der Vergangenheit an…

Googles Social Graph API

Wie schon mehrfach berichtet wurde, hat Google mit der Social Graph API einen großen Schritt in Richtung DataPortability gemacht. Die Social Graph API ist eine weiterer Coup von Brad Fitzpatrick (Live Journal, memcached und OpenID) und bietet eine einfache API um “public connections” die man zu genüge im Netz erstellt hat zu interpretieren um wiederverwendbar zu machen.

With the Social Graph API, developers can now utilize public connections their users have already created in other web services. It makes information about public connections between people easily available and useful.

Social Graph API Die Google API setzt hauptsätzlich auf das Microformat XFN (V 1.1) zum darstellen des Sozialen Netzes.

XHTML Friends Network benutzt das rel Attribut von Links um Verbindungen zwischen Personen darzustellen. <a rel="me" /> kennzeichnet z.B. eine weitere Webseite des Verlinkenden. Weitere Formate (bei Google Edge Types) sind das auf RDF basierende FoaF und OpenID delegation Links <link rel="openid.delegate" />.

Die API ist recht simple und lässt sich komplett über URL Key/Value Paare konfigurieren…

http://socialgraph.apis.google.com/lookup?<parameter 1>&<parameter 2>&<parameter n>

…und stellt die Ergebnisse in JSON dar.

Social Graph API Client

Steve Ivy einer der Gründer des DiSo Projekts hat eine Social Graph API Client Klasse in PHP geschrieben und im DiSo SVN zur Verfügung gestellt.

I wrote a quick and dirty client in PHP that cosumes the JSON and returns it in a data structure. #

Continue reading ‘Googles Social Graph API’




Livecommunity powered by six groups