tw mail open hack day 2
DESCRIPTION
yahoo mail 新平台TRANSCRIPT
Y! Open Mail 教戰手冊
WenChi Wang17th Oct. 2009
Agenda
• Introduction
• Building your first OpenMail application
• Reference
3
Introduction
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)
5
Building your first OpenMail application
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
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
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)
9
Screenshots
Dev Tool
1. invite your friend
2. Friend accept application
3. Friend can play your application
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>
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>
16
Reference
Reference
http://developer.yahoo.com/mail/docs/user_guide/
18
Happy Hacking!!!Thank You!
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
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