Archive forGeneral

Digg API

Fianally Digg launched their API :

The Digg Application Programming Interface (API) has been created to let users and partners interact programmatically with Digg. The API returns Digg data in a form that can be easily integrated into an application or a web site.

See the documentation at http://apidoc.digg.com/

Here's some interesting parts from their docs:

Be Polite, Please!

Use good judgment when designing your application. Don't make repeated requests for the same data frequently. […] We monitor API usage, and we may block applications that do silly things.

They also launched a contest for using this API.

Comments

Google AdSense API

Google has just opened for all developers their AdSense API introduced last year:

If you're a web developer or host, you may remember that we introduced you to the AdSense API last May. With the AdSense API, your users can create their own AdSense accounts on your site, and display ads alongside the content that they have created. They can also manage their accounts and view ad performance and earnings reports, all on your site.

Today, we're pleased to announce that the AdSense API is now open for all developers, with the release of our open development sandbox. This is a replica of the live service with some additional support to help you test and debug your applications. Once you implement the AdSense API in the development sandbox, we can go live with your implementation.

Using this API you can share advertising revenues with creating content online users without webnasters worrying too much about accounting and money, all managed by Google. It looks liek a win-win situation for everybody.

Some already fear that AdSense API will skyrocket click-fraud. However this is a sample account creatin using PHP straight from their online documentation:

<?php

// Copyright 2005, Google Inc. All rights reserved.

/**
 *  sample code to create an Adsense account through Adsense API
 */

require_once('lib/nusoap.php');
require_once('common.php');

$server = 'https://www.google.com';
$namespace = 'http://www.google.com/api/adsense/v2';

// Set up the authentication headers
$email = '<impl:developer_email>REPLACE WITH DEVELOPER EMAIL</impl:developer_email>';
$password = '<impl:developer_password>REPLACE WITH DEVELOPER PASSWORD</impl:developer_password>';
$client_id = '<impl:client_id>NOT RELEVANT</impl:client_id>';

$header = $email . $password . $client_id;

// creating soap client
$wsdl = $server . '/api/adsense/v2/AccountService?wsdl';
$client = new soapclient($wsdl, true);
$err = $client->getError();
if ($err) {
  showSoapClientError($err);
  return;
}
$client->soap_defencoding = 'UTF-8';

// Set the headers; they are needed for authentication
$client->setHeaders($header);
if ($client->fault) {
  showMyErrors($client);
  return;
}
$err = $client->getError();
if ($err) {
  showSoapClientError($err);
  return;
}

// setting the parameter
$param = '<loginEmail>users_address_here@example.com</loginEmail>';
$param .= '<entityType>Individual</entityType>';
$param .= '<websiteUrl>http://test.aaa.com</websiteUrl>';
$param .= '<websiteLocale>en</websiteLocale>';
$param .= '<usersPreferredLocale>en_US</usersPreferredLocale>';
$param .= '<emailPromotionPreferences>true</emailPromotionPreferences>';
$param .= '<synServiceTypes>ContentAds</synServiceTypes>';
$param .= '<hasAcceptedTCs>true</hasAcceptedTCs>';
$param = '<createAdSenseAccount>' . $param . '</createAdSenseAccount>';

// invoke web service
showCall('createAdSenseAccount', $param);
$response = $client->call('createAdSenseAccount', $param, $namespace);
if ($client->fault) {
  showMyErrors($client);
  return;
}
$err = $client->getError();
if ($err) {
  showSoapClientError($err);
  return;
}

// get back the response
$response = $response['createAdSenseAccountReturn'];
showCreatedPublisher($response);

// showing the soap
showRequestResponse($client);

?>

Comments

yourminis opens up the widget platform, releases API

Via ZDnet Blogs: yourminis opens up the widget platform, releases API

Tonight yourminis announced the availability of their API, giving developers a way to build widgets and upload them. In addition, the team released an analytics application that will help you track where your widget is going and how many people are using it. All of this is under a developers section on the yourminis page which includes information on how to get started and the files you'll need to download.

What are minis? They are personalized widgets for desktop or web sites made with Adobe Flash.

Comments

Yahoo! Mail Web Service APIs

Yahoo! announced today availability for its Mail Web Service APIs:

With the Yahoo! Mail Web Service APIs, you can build applications to perform tasks such as listing messages, displaying folders, and composing and sending messages.

Here's an authentication example from their samples:

<?php
// test.php — Test Yahoo! Browser-Based Authentication
// A simple auth exmaple.
// Author: Jason Levitt
// Date: November 20th, 2006
// Version 1.0
//

// Edit these. Change the values to your Application ID and Secret
define("APPID", 'JzkILqzIkY1xxxxxxxxxIaGILaRWClvO');
define("SECRET", '10de7e35xxxxxxxxxe5749207495ed');

// Include the proper class file
$v = phpversion();
if ($v[0] == '4′) {
include("ybrowserauth.class.php4″);
} elseif ($v[0] == '5′) {
include("ybrowserauth.class.php5″);
} else {
die('Error: could not find the bbauth PHP class file.');
}

function CreateContent() {

$authObj = new YBrowserAuth(APPID, SECRET);

// If Yahoo! isn't sending the token, then we aren't coming back from an
// authentication attempt
if (empty($_GET["token"])) {
// You can send some data along with the authentication request
// In this case, the data is the string 'some_application_data'
echo 'You have not signed on using BBauth yet<br /><br />';
echo '<a href="'.$authObj->getAuthURL('some_application_data', true).'">Click here to authorize</a>';
return;
}

// Validate the sig
if ($authObj->validate_sig()) {
echo '<h2>BBauth authentication Successful</h2>';
echo '<h3>The user hash is: '.$authObj->userhash.'</h3>';
echo '<b>appdata value is:</b> '. $authObj->appdata . '<br />';
} else {
die('<h1>BBauth authentication Failed</h1> Possible error msg is in $sig_validation_error:<br />'. $authObj->sig_validation_error);
}

return;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8″ />
</head>
<body>
<div id="look">
<h2>Test BBauth </h2>
<div>
<?php CreateContent(); ?>
</div>
<div id="content">
</div>
</div>
</body>
</html>

They also offers $10 commission for developers which refer clients to premium Yahoo! Mail account.

Comments

Blogger API Updated

I've just read about Blogger API updates you might be interested. Seems that they updated documentation and code samples, but also integration with other Google products, especially Calendar. Good to know.

Comments

Facebook web API

Popular (mostly among teenagers) social networking site Facebook.com has launched their web API. After you register your API key you have access to a few methods like friends.get, photos.getAlbums or users.getInfo. Basically, you have access to your friends, photos, messages or events.

They have a limit of 100,000 requests in 24 hours period. For details see online documentation.

Comments

Next big thing: Web Authentication API

I'm pretty sure one next big thing will be web authentication API available from many well-known websites. Yahoo offers such thing, but only for Flickr users.

Today Google released their account authentication, but only for 'installed applications'. Web applications will follow sometime this month (hopefully).

What this means? They are offering web based authentication against accounts created on their servers. This way an user doesn't need to create a separate account on other site, they can authenticate using an account he already have. These open many possibilities, especially for big websites, which I'm almost sure at a point will open this authentication process to everyone who want to use, as long as they own user accounts. For users, it's much easier to maintain only a few accounts, available from many other places.

Something like this wanted to be passport.net from Microsoft, available mainly for different Microsoft sites.

I'll closely see how these will develop, because I'm very interested using these authentication APIs. [digg it]

Comments

Google Calendar API

Google has just released their web API for calendar (on Apr 20):

Google Calendar allows client applications to view and update calendar events in the form of Google data API ("GData") feeds. Your client application can use the Google Calendar data API to create new events, edit or delete existing events, and query for events that match particular criteria. 

There are a few steps to use Google Calendar, all described in their help files:

  • Create an account
  • Get magic cookie for your calendar, or feed URL (something like http://www.google.com/calendar/feeds/userID/private-magicCookie/full)
  • Request the feed, which returns a XML file;
  • Post back an event or comments with a XML file.

We'll be back shortly with a full featured example using PHP.

Comments

Ajax Standardization

I've just read Borland's Pawel Glowacki blog about beginnings of AJAX standarization.

On April 5th W3C published a working draft about XMLHttpRequest Object, the core of AJAX technology:

Abstract

This specification defines the XMLHttpRequest object, an API that provides some HTTP client functionality.

1. Introduction

This section is informative

The XMLHttpRequest object is an interface exposed by a scripting engine that allows scripts to perform HTTP client functionality, such as submitting form data or loading data from a remove Web site.

The XMLHttpRequest object is implemented today, in some form, by many popular Web browsers. Unfortunately the implementations are not completely interoperable. The goal of this specification is to document a minimum set of interoperable features based on existing implementations, allowing Web developers to use these features without platform-specific code. In order to do this, only features that are already implemented are considered. In the case where there is a feature with no interoperable implementations, the authors have specified what they believe to be the most correct behavior.

Future versions of this specification (as opposed to future drafts of this version) may add new features, after careful examination from browser developers and Web content developers.

This specification was originally derived from the WHAT WG's Web Applications 1.0 document. The authors acknowledge the work of the WHAT WG in documenting existing behavior.

So, AJAX is here to stay? Interesting stuff.

Comments

Welcome to COMET

Do you know what COMET is? According to Alex Russell COMET is the next stage of AJAX:

"New services like Jot Live and Meebo are built with a style of data transmission that is neither traditional nor Ajax. Their brand of low-latency data transfer to the browser is unique, and it is becoming ever-more common. Lacking a better term, I’ve taken to calling this style of event-driven, server-push data streaming “Comet”. "

Basically, is a new approach of open channel between web servers and client browsers, or a push technology: servers can send to the clients unsolicited responses. Other important issue is that is event driven.

This technology needed a name. Now is here, coined to Alex Russell, so I'm almost sure we'll read about it almost everywhere, very soon.

I totally agree with this solution because for a powerful web based application there is a need for two way communication: clients need to request information from servers, but also server should need a way to push information to the client.

Problem is that technology is not there, yet. This would be implemented server-side, in web servers, and is not done yet. Don't search for Apache MODs or IIS extensions because you won't find them, but most important is that is possible with actual technology client-side and some implementation server-side. The sites mentioned above already use it, so it's almost here.

I'm pretty sure this technology will spread rapidly as soon as web servers libraries will be available because allows developers to build interesting and catchy web apps.

I've read Ajaxian comments and mention of old 1997 Push technology, but COMET looks very different: it doesn't start with general ideas but with real implementations, based on today's products (web servers & browsers).

The only problem I see is to provide practical anti-spam solutions. I'm sure many spammers would be interested to push their crap in client browsers. If the user will be still in control and everything would be easy to use (no other installations) this technology could have a bright future, I think. I'd expected for it for some time, because I'm almost sure we'll have it in the future, even if is called COMET or something different.

Welcome to COMET.

Comments

· « Previous entries