Archive

Archive for November, 2009

鸟瞰淘宝开放平台

November 12th, 2009 Bali No comments

概述

Taobao Open Platform(TOP),淘宝开放平台,是淘宝将一些(不是全部)数据(店铺,商品等)通过编程接口开放给开发者。说简单点是这样,一般我们大家都是在网页里面点点点,来装修店铺,买卖东西的,是人肉通过鼠标和键盘完成的。TOP API,可以帮助大家用程序来完成同样的事情。

目标

该文主要回答一下几个问题:

1) 淘宝为什么开放平台?对于开发者意味着什么?

2) 开放了些什么东东?

3) 如何写一个简单的基于开放平台应用?

淘宝开放的缘由

Taobao经过几年的发展,已经成为国内X2C的头块品牌。它发起并完善了广大的网商,用户,以及与之相关的支付,物流,信用等系统。现在基本无人不淘宝。我的一位同事,所有的东西基本上都在taobao上买,还有一位朋友一大爱好就是周末在taobao上买东西。

但淘宝已经差不多到了不得不开放的地步。在内部,大的卖家渴望走出去,店主渴望以某种方式在300w个网店中脱颖而出,各种购买方式层出不穷,团购、限时拍卖等;在外部,社区、sns、购物搜索已经开始直接或间接涉足X2C市场。面对这么多元化的需求,淘宝自己去满足,肯定会力不从心;视而不见,那会引起积怨,累计到一定程度,必然有后来者取而代之。那怎么办?简单。既然这个钱,我不想赚,那就帮别人去赚,但你们得围绕着我来玩。开放应运而生。如果要看fancy版本的同样解释,请看博文:

小前端、大后台 路鹏(淘宝副总裁)

业务方向

现在淘宝主推三大业务方向:独立网店、社区电子商务化、第三方开发的工具海。

· 淘宝不讳言独立网店,真是很令人佩服。独立网店的样品工程就是优衣库,基本思路就是网站的域名和UI是独立网店的,其他的东西都是淘宝的,比如用户、支付、商品信息等。ShopEx在这方面是淘宝的合作伙伴。

· 社区电子商务化。简单来说,就是在bbs(如天涯)和sns(如人人网)中通过TOP API展示淘宝上商品,一但成交,大家分钱。

· 工具海。做垂直行业的商家管理工具,卖给旺铺卖家。

当然还有其他。参考:TOP业务方向

盈利模式

光炒概念,没有盈利模式的事情,我一向是只看不碰。那大多只是烧钱者的游戏,一般人玩儿不起。淘宝开放还是有比较清楚的变现模式的(包括但不限于):

· 淘宝客佣金。淘宝客是按成交计费的,CPA模式。而且API中允许用户加入一些自定义数据,用于确定购买行为过程中的贡献方,使得分享利润成为可能。以前写过篇文章,就提到分享利润的一个应用

· 插件分成。插件分为店铺管理插件和淘江湖SNS平台插件。前者是方便管理店铺用的,后者偏重娱乐性,概念类似Facebook的应用

· 软件销售。C/S模式,或者ShopEx独立网店大多属于这种模式。

· 传统广告。比如你调用淘宝API生成网页,加Google AdSense进入,也是可以的。

参考:TOP盈利模式

API

参考:TOP API文档

API/角色

六个基本角色,权限从低到高依次为:公开查询应用、买家应用、卖家应用、商家应用、高级应用、专业应用。较高角色的权限包含较低角色的权限。

还有三个独立角色,社区应用、媒体应用、淘宝客应用。相互独立,与六个基本角色不存在依赖关系。

API/分类

API操作的对象,有如下11种:用户,产品,类目,商品,交易,评价,物流,店铺,淘宝客,淘江湖(v=2.0),图片空间。

API基本的命名规则是<namespace>.<object>.<action>,如taobao.item.get用于获取单个商品的详细信息。

API/如何进行API调用

基于REST协议的API。调用接口地址是:

测试环境地址:http://gw.api.tbsandbox.com/router/rest

正式环境地址:http://gw.api.taobao.com/router/rest

TOP会给每个应用分配app_keyapp_secret,相当于该应用的用户名和密码。API调用传入的参数分为系统参数(每个API都需要,且格式相同)和API专有参数(随API不同而不同)两类。系统参数中,app_key由系统分配所得,session通过下列方法获得,而sign是根据签名规则生成,其实就是通过一个hash函数完成了加密和校验的双重功能。这和Facebook的那一套东西很像。

参考:TOP API系统级参数定义 How Facebook Authenticates Your Application

Demo

TOP开放的是基于RESTAPI,和编程语言无关的。下面用Java语言为例,写个hello world

不用TOP Java SDKdemohttp://open.taobao.com/demo/javaDemo.zip

TOP SDKdemo: http://wiki.open.taobao.com/index.php/FAQ

注意:SDK给的其实Java源文件,需要copy到源文件的目录下,进行编译。

taobaoke AD

November 7th, 2009 Bali No comments

大家可能注意到blog上方多了广告,来自taobao称为淘宝客。这是个新的实验性质的尝试。多数都是靓衣美女,没有购买意愿的朋友,就养养眼吧,呵呵。

Categories: Chinese - 中文 Tags:

Win7那些事儿(3) – Hesitate to reinstall?

November 7th, 2009 Bali No comments

I am lazy, as many folks are. One of compelling reasons for personal user not installing Win7 is as following,

“Win7 requires a clean install, which mean I will lost 2 days to back to full productivity. I have to reinstall my applications one by one, and set setting, and restore my data.”

If you agree with above claim. This post is for you. Read along.

1 Introduction

MyApps is a suite of technologies which allow users easily manage and distribute all their Windows applications in most convenient way than before. MyAapps is the name.

2 Problem

Have you ever hesitated rebuilding your dev machine to clean up an instability issue after looking at installed about 200 programs?

Have you ever help new members in your team setup and configure his development environment per strict team-acorss guidelines?

Have you ever had to exit setup dialog to install bunch of prerequisites?

Do you have to remember a long list of license key or file?

You may notice that existing processes that maintain applications and their settings in users’ computer are painful and time-consuming. The explosive growth of applications makes users be tired of finding software, waiting for download, playing with options, accepting defaults, inputting license key or file, clicking through and waiting reboot, especially when they are forced to repeat similar steps again and again. MyApps are technologies which change the way people distribute, access and manage various applications in their computer.

3 Solution

3.1 Unique Values

The unique values MyApps offer can be expressed as followings.

  • Easy installation – Users can install any application with one click.
  • App bag support – App list is a list of applications with customized options. Rebuild becomes never easier. You can kick off the installation of hundreds of applications within minutes, and go away to have a cup of coffee.
  • App bag sharing – You can share your application list to your team member or friends, and they can easily repro your environment.
  • Automatic dependency management – MyApps is aware of app dependency and will install all dependent apps for users automatically.
  • License management – do not need save license key/file locally any more. MyApps does that for users.

3.2 Core Scenarios

Key scenarios that MyApps addresses include:

  • One-stop installFrank needs building his dev machine containing about 120 various apps as the first dev of team COOL5. He logs onto MyApps site and set his preferences (e.g., install all apps onto D:\frankapps\) as the first time visitor. He browses/search the software and put them into MyCart of MyApps site. Finally, he accepts all EULAs and clicks Install, and then goes away for half-day training. When he returns, he finds that his computer is installed with latest software and ready to go.
  • Dependency awareness and license handling – .NET 3.5 is required by one of Frank’s selected app – SpeedLaunch, and is installed automatically along with SpeedLaunch. MyApps is also smart enough to handle license at the background for Frank.
  • Share app bagFrank starts customizing his apps. Frank points a debugging tool to an internal team testing DB. The setting is uploaded to public section in CuteInstall site. Frank sets font size to 12 in his VS2008 and uploads this to the private section. Finally Frank published his current app bag as “COOL5_dev_bag” in the MyApps site.
  • No need re-invent the wheelJoanne, the second dev of COOl5 team, install all apps same with Frank by clicking the link in his onboard email:

http://MyApps/install.aspx?bid=COOL5_dev_bag

Joanne also finds out that the debugging tool points to the team testing DB.

  • Easy repro – Months later, Frank has to rebuild his computer to clean out certain instability issues although he is facing tight schedule. Frank logs onto CuteInstall site and with his account and clicks “Restore to latest” button before he leaves office. The second day, Frank gets a fresh working machine with all his favorite private settings (e.g., font is 12 in VS2008) and continue working for his deadline without any delay.
  • Software shopping Sara, a regular computer user, logs onto a MyApps technology enabled online software shop with her Live ID. She decides to buy Office2007 and pays the bill using PayPal. After clicking “Install”, Office2007 is delivered/installed/Configured to her computer through a CDN network within 1/2 hour. She is very happy because she no long needs wait for DVD delivered by UPS again.

3.3 Value Proposition

For customers, the value propostion is pretty obvious if you look at the above scenarios carefully. It save man hours in every application installation and migration, increase productivity and improve across-team capabilities to meet business goals.

For Microsoft, it is also a “must have”. MyApps makes Windows platform more accessible and easy to manage. MyApps technologies bright customers’ unique values by leveraging our Windows platform leadership and global presence of Live platform. It also provides special value to our S+S strategy. More and more people turn to web app mostly because web app is:

  1. Easy available
  2. No download(s) and installation(s) required
  3. Your settings always go with you

MyApps technologies solve above 3 problems altogether. Software installation and maintenance are no longer headache for users. As a result, this ensures the success of Microsoft S+S strategy and strengthens our long term value. It is beneficial to the whole industry and any and every software users.

4 Logical Architecture

The diagram below shows the logical architecture of MyApps platform.

Arch of MyApps

Arch of MyApps

Two innovative concepts MyApps introduces are as follows:

  • Split of static and dynamic bits of apps which will be stored in App bits DB and App settings/bags DB respectively
  • App release description script

To achieve these goals, MyApps technology contains a suite of software component and standard.

  • MRT (MyApps Releasing Toolkit) – software vendors use this tool to write installer code. MRT is based on WSI.
  • MP (MyApps Portal) – it is centralized place which stores all configurable settings of all apps. And it is also responsible for managing software installation, licensing and user configurations.
  • MC (MyApps Client) – MC will be running on software users side to manage installation and settings.

Next we will discuss components one by one.

4.1 MyApps Releasing Toolkit

Every software release should provide a XML file like below.

<?xml version=1.0 encoding=utf-8?>

<App>

<Name>Microsoft.OfficeLabs.PeerMail</Name>

<Version>1.1.0.0</Version>

<DependencyManagement>

<Dependency>

<App>

<Name>Microsoft.DotNet</Name>

<Version>2.0</Version>

</App>

<App>

<Name>Microsoft.Office.Outlook</Name>

<Version>12.0.6213.1000</Version>

</App>

</Dependency>

</DependencyManagement>

<InstallSteps>

<step_by_step_install_guide_by_XML></step_by_step_install_guide_by_XML>

</InstallSteps>

</App>

This file makes sure that (1) the app gets globally unique name with Name and Version, (2) Dependency is clearly defined, (3) InstallSteps will reuse certain tasks pre-defined by MRT. The tasks sample provided by MRT will be to create folder, register COM component, start certain services, copy files, etc. MRT will read this file and generate releasing package.

4.2 MyApps Portal

MyApps Portal is the only place where users browse, search, install, configure, manage and share their apps across all their computers.

4.3 MyApps Client

MyApps will be running in software users as ActiveX IE plugin. Every app defines its config DB as following:

<?xml version=1.0 encoding=utf-8?>

<Configs>

<Section1>

<Property Key=key1 Value=value1 />

<Property Key=key2 Value=value2 />

</Section1>

<Section2>

<Property Key=key3 Value=value3 />

<Property Key=key4 Value=value4 />

</Section2>

</Configs>

We can use lightweight DB component(e.g., SQLite, or SQL Express) to achieve that.

5 Go TO Market Strategy

Business model would be software licensing.

MyApps is not just for resintalling the whole software stack. It actually allows users to maintain streamlined application and settings across the computer overtime. I will probably to start a project in CodePlex for this.

Acknowledgment: MyApps is inspired by Maven for Java, RubyGems for Ruby, CAPN for Perl, YUM for Linux, etc. I am actually surprised that Windows don’t have this till today. Ninite is likely, but far from solving the problem entirely.