| Package | com.yahoo.social.methodgroups |
| Class | public class YQL |
| Inheritance | YQL YOSMethodBase flash.events.EventDispatcher |
var session:YahooSession = new YahooSession('$consumerKey','$consumerSecret');
session.yql.addEventListener(YahooResultEvent.YQL_QUERY_SUCCESS, handleQuerySuccess);
session.yql.query("select from geo.places where text='YVR'");
function handleQuerySuccess(event:YahooResultEvent):void
{
// get the query result
var results:Object = event.data.results;
// and then do something awesome
}
// provide access tokens to get the sessioned user in order to access their profile information
var session:YahooSession = new YahooSession('$consumerKey','$consumerSecret','$accessToken','$accessTokenSecret');
var user:YahooUser = session.getSessionedUser();
user.yql.addEventListener(YahooResultEvent.YQL_QUERY_SUCCESS, handleQuerySuccess);
user.yql.query("select from social.profile where guid=me");
function handleQuerySuccess(event:YahooResultEvent):void
{
// get the query result
var results:Object = event.data.results;
// and then do something awesome
}
// Directly create a YQL object and use the queryPublic method to access any public information.
var yql:YQL = new YQL();
yql.addEventListener(YahooResultEvent.YQL_QUERY_SUCCESS, handleQuerySuccess);
yql.queryPublic("select from weather.forecast where location=98101");
function handleQuerySuccess(event:YahooResultEvent):void
{
// get the query result
var results:Object = event.data.results;
// and then do something awesome
}
See also
| Property | Defined by | ||
|---|---|---|---|
![]() | consumer : OAuthConsumer
An OAuthConsumer object containing consumer key and secret values.
| YOSMethodBase | |
| environmentFile : String
The optional YQL environment file.
| YQL | ||
![]() | token : OAuthToken
An OAuthToken object containing access token key and secret values
This value is only used if a user is not defined when signing a request with OAuth.
| YOSMethodBase | |
![]() | user : YahooUser
The user referenced in all data requests.
| YOSMethodBase | |
| Method | Defined by | ||
|---|---|---|---|
|
YQL()
Class constructor.
| YQL | ||
|
query(query:String):void
Sends a single query to the YQL web service.
| YQL | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
![]() | Dispatched when a request fails due to a security error. | YOSMethodBase | ||
| Dispatched when the query request fails. | YQL | |||
| Dispatched when the query request executes successfully. | YQL | |||
| environmentFile | property |
environmentFile:String [read-write]The optional YQL environment file.
Implementation public function get environmentFile():String
public function set environmentFile(value:String):void
| YQL | () | constructor |
public function YQL()Class constructor. Creates a new YQL object.
| query | () | method |
public function query(query:String):voidSends a single query to the YQL web service.
Parametersquery:String — A string, using a SQL-like SELECT syntax.
|
| yqlQueryFailure | event |
| yqlQuerySuccess | event |