Tw Mail Open Hack Day 2

20
Y! Open Mail 教教教教 WenChi Wang 17 th Oct. 2009

description

yahoo mail 新平台

Transcript of Tw Mail Open Hack Day 2

Page 1: Tw Mail Open Hack Day 2

Y! Open Mail 教戰手冊

WenChi Wang17th Oct. 2009

Page 2: Tw Mail Open Hack Day 2

Agenda

• Introduction

• Building your first OpenMail application

• Reference

Page 3: Tw Mail Open Hack Day 2

3

Introduction

Page 4: Tw Mail Open Hack Day 2

4

Application Scope

• Accessing Mail Features– Application can get access to user’s e-mail content (on a manual drag-drop basis

only)– Application can trigger a new mail 'Compose' ( but cannot automatically send a

mail)

• Accessing Yahoo! Calender– Application can ’Add a new event’

• Accessing user’s data on Yahoo! Network– Either using YQL or individual Yahoo! Property level webservice (e.g Mail,

Answers etc)

• Application Rendering Options– Tabbed View and Dialog View

• Application Space– Each application gets a storage space of 5 mb for application components ( js,

css, images etc)

• Only available with ’All new Yahoo! Mail’ (not with Yahoo! Mail Classic)

Page 5: Tw Mail Open Hack Day 2

5

Building your first OpenMail application

Page 6: Tw Mail Open Hack Day 2

Becoming a YMDP developer

• Setup Account- Send the following information to [email protected]

1. YID2. Bouncer Info (First+Last Name/Company Email/Company Name)

• Active Account- https://developer.mail.yahoo.com/openmail/dev_activate.php

• Develop your codes- Web Version:

http://developer.mail.yahoo.com/openmail/devtool.php- Command Line Version : https://developer.mail.yahoo.com/openmail/downl

oad_ymdt.php

• Test Your Code- https://mail.yahoo.com

Page 7: Tw Mail Open Hack Day 2

Getting Start for 2009 Open Hack Day

• Setup Information YID: tw_openhack_[2-20] / password: hack2009

Bouncer Info: “$YID”/Kimohack2009 • Enable OpenMail

http://developer.mail.yahoo.com/openmail/enable_om.php

• Dev Tool (Web Based)http://developer.mail.yahoo.com/openmail/devtool.php

Page 8: Tw Mail Open Hack Day 2

What will be in your App

• General Setup (一般) - Info about your application (name/description/icon)

• Application configuration (應用程式) - XML specification of various meta data

• Views( 檢視) - Views are simply HTML- Each page of an open Mail Application is called a view- An application can be collection of one/more views

• Authorization* - Oauth (key, secrete, authentication)

• Assets( 資源) * - JS/CSS - images for Mail UI - Total size up to 5 MB

• Legal ( 授權) * - Oauth (key, secrete, authentication)

Page 9: Tw Mail Open Hack Day 2

9

Screenshots

Page 10: Tw Mail Open Hack Day 2

Dev Tool

Page 11: Tw Mail Open Hack Day 2

1. invite your friend

Page 12: Tw Mail Open Hack Day 2

2. Friend accept application

Page 13: Tw Mail Open Hack Day 2

3. Friend can play your application

Page 14: Tw Mail Open Hack Day 2

14

Hello World Example

Config ( 應用程式 Tab )<openmail_app_config version="2"> <data/> <events> <click> <action> <launch> <view>main</view> <target_zone>tab</target_zone> </launch> </action> </click> </events></openmail_app_config>

Page 15: Tw Mail Open Hack Day 2

15

Hello World Example

View ( 檢視 Tab )<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html><head><!-- Required scripts for using the Yahoo Mail Developer Platform API --><script src="http://yui.yahooapis.com/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js"></script><script src="http://yui.yahooapis.com/2.6.0/build/json/json-min.js"></script><script src="http://mail.yimg.com/a/lib/om/crossframe/1.0.18/crossframe-min.js"></script><script src="http://mail.yimg.com/a/lib/om/om_api_public/1.0.4/om_api_public.js"></script></head><body><textarea id="body" cols="80" rows="20">Enter some text and press the compose button.</textarea><p/><button onclick="demoCompose()">compose</button><script>function demoCompose(){var bodyTxt = document.getElementById('body').value;openmail.Mail.compose({ to: 'my friend',subject: 'hello world',body: bodyTxt });}</script></body></html>

Page 16: Tw Mail Open Hack Day 2

16

Reference

Page 17: Tw Mail Open Hack Day 2

Reference

http://developer.yahoo.com/mail/docs/user_guide/

Page 18: Tw Mail Open Hack Day 2

18

Happy Hacking!!!Thank You!

Page 19: Tw Mail Open Hack Day 2

Available APIs

• Web Services- Request are sent through Adobe Flash- Requests have a crossdomain.xml file configured to accept '*.yimg.com' domains- Use openmail.Application.callWebService method to make the call- More info at http://om0001.mail.mud.yahoo.com/om/docs/OpenapiPublic/Application.html

• For generating Views- openmail.Application.openView()- openmail.Application.closeView()- More info at http://om0001.mail.mud.yahoo.com/om/docs/OpenapiPublic/Application.html

Page 20: Tw Mail Open Hack Day 2

Available APIs contd...

• Interacting with Mail- openmail.Mail.compose() - used to compose a new mail- openmail.Mail.search() - this method will initiate a keyword search inside mail- More info at http://om0001.mail.mud.yahoo.com/om/docs/OpenapiPublic/Mail.html

• Accessing Application Data- openmail.Application.setData() – persistently stores the given key-value pair object in the application

space- Openmail.Application.getData() – retrieve the values of the keys from the application space- More info at http://om0001.mail.mud.yahoo.com/om/docs/OpenapiPublic/Application.html