Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 154 lines (106 sloc) 5.525 kb
9ce79d0 Zach Graves adding readme
zachgraves authored
1 YAP Friend Picker
2 ========================
3
a1ffd15 Zach Graves readme
zachgraves authored
4 The YAP Friend Picker is a Flex component that makes it easy to drop-in sharing and messaging capabilities into your YAP application.
0287529 Zach Graves readme
zachgraves authored
5 Using Yahoo! ASTRA and YQL, the
a1ffd15 Zach Graves readme
zachgraves authored
6
9ce79d0 Zach Graves adding readme
zachgraves authored
7 Yahoo! Application Platform
8 =======
9
10 Find documentation and support on Yahoo! Developer Network: http://developer.yahoo.com
11
12 * Yahoo! Application Platform - http://developer.yahoo.com/yap/
13 * Yahoo! Social APIs - http://developer.yahoo.com/social/
14 * Yahoo! Query Language - http://developer.yahoo.com/yql/
0287529 Zach Graves readme
zachgraves authored
15 * Yahoo! ASTRA components - http://developer.yahoo.com/flash/
9ce79d0 Zach Graves adding readme
zachgraves authored
16
0287529 Zach Graves readme
zachgraves authored
17 Hosted on GitHub: http://github.com/ydn/yap-friendpicker/tree/master
9ce79d0 Zach Graves adding readme
zachgraves authored
18
19 License
20 =======
21
22 @copyright: Copyrights for code authored by Yahoo! Inc. is licensed under the following terms:
23 @license: BSD Open Source License
24
25 Yahoo! Social SDK
26 Software License Agreement (BSD License)
27 Copyright (c) 2010, Yahoo! Inc.
28 All rights reserved.
29
30 Redistribution and use of this software in source and binary forms, with
31 or without modification, are permitted provided that the following
32 conditions are met:
33
34 * Redistributions of source code must retain the above
35 copyright notice, this list of conditions and the
36 following disclaimer.
37
38 * Redistributions in binary form must reproduce the above
39 copyright notice, this list of conditions and the
40 following disclaimer in the documentation and/or other
41 materials provided with the distribution.
42
43 * Neither the name of Yahoo! Inc. nor the names of its
44 contributors may be used to endorse or promote products
45 derived from this software without specific prior
46 written permission of Yahoo! Inc.
47
48 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
51 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
52 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
54 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58
59
60 The Yahoo! Social SDK code is subject to the BSD license, see the LICENSE file.
61
62
63 Requirements
64 ============
65
66 The following dependencies are bundled with the Yahoo! PHP SDK, but are under
67 terms of a separate license. See the bundled LICENSE files for more information:
68
69 * Flex 3.5 - http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3
70 * FlexLib - http://code.google.com/p/flexlib/
71 * as3corelib - http://code.google.com/p/as3corelib/
72
73
74 Installation
75 ============
76
77 After downloading and unpacking the release, import the directory into a new
78 Flash Builder project.
79
80
81 Examples
82 ========
83
84 The sdk comes with an example application, but you must first set the
85 OAuth consumer key and secret in the main application MXML file.
86
87
88 private static const CONSUMER_KEY:String = "YOUR_CONSUMER_KEY";
89 private static const CONSUMER_SECRET:String = "YOUR_CONSUMER_SECRET";
90
91
92 Create OAuth applications in the Yahoo! Developer Dashboard:
93
94 http://developer.yahoo.com/dashboard/
95
96
97 ## Using the component:
98
99 Using the component is as simple as adding the component MXML to your application.
100
101 <friendpicker:FriendPicker id="friendPicker" width="350" height="500"/>
102
103 On initialization of the application, you must supply the component with OAuth
104 credentials in order to request social information from YQL. The sample application
105 uses Flashvars to provide this data, as shown below.
106
107 var flashvars:Object = Application.application.parameters;
108
109 var consumer:OAuthConsumer = new OAuthConsumer();
110 consumer.key = CONSUMER_KEY;
111 consumer.secret = CONSUMER_SECRET;
112
113 var token:YahooAccessToken = new YahooAccessToken();
114 token.key = flashvars.yap_viewer_access_token;
115 token.secret = flashvars.yap_viewer_access_token_secret;
116 token.yahoo_guid = flashvars.yap_viewer_guid;
117
118 friendPicker.setup({
119 application: new YahooApplication(consumer.key, consumer.secret, flashvars.yap_appid, token),
120 type: flashvars.type,
121 subject: flashvars.subject,
122 body: flashvars.body,
123 cancelURL: flashvars.cancelURL
124 });
125
126 ## Displaying on YAP
127
128 The following markup used to display Flash content in YAP applications.
129 An absolute URL to the Flash SWF is required, along with a query-string defining the flashvars.
130
131 <yml:swf
132 src="http://your-application.com/swf/YAPFriendPicker.swf"
133 width="350"
134 height="500"
135 flashvars="type=message&subject=message+subject&body=message+body&yap_viewer_access_token=...&yap_viewer_access_token_secret=...&yap_viewer_guid=..."
136 />
137
138 PHP Example
139
140 $config = array(
141 'type' => 'message',
142 'subject' => '%MessageSubject%',
143 'body' => '%MessageBody%',
144 'yap_viewer_access_token' => $_POST['yap_viewer_access_token'],
145 'yap_viewer_access_token_secret' => $_POST['yap_viewer_access_token_secret'],
146 'yap_viewer_guid' => $_POST['yap_viewer_guid'],
147 'yap_appid' => $_POST['yap_appid']
148 );
149
150 $flashvars = http_build_query($config);
151
152 echo "<yml:swf flashvars='$flashvars' src='http://your-application.com/swf/YAPFriendPicker.swf' width='350' height='500'/>";
153
Something went wrong with that request. Please try again.