Class for making public YQL queries
Execute YQL query
Gets the @var placeholders
Get the query params and validate placeholders
Get the the request url
Two legged Auth is simple request which is signed prior to sending
Set-up the basic parameters needed for a request
Get the the request url
Three-legged Auth is used when it involves private data such as a user’s contacts.
Three-legged auth is most likely to be used in a web-site or web-accessible application. Three-legged auth requires the user to authenticate the request through the Yahoo login.
Three-legged auth requires the implementation to:
For an implementation this will require calling the following methods in order the first time the user needs to authenticate
Once the access token has been provided subsequent requests can re-use it.
Access tokens expire after 1 hour, however they can be refreshed with the refresh_token() method
Check to see if a token has expired
Get the access token
The verifier (required) should have been provided to the user following login to at the url returned by the get_token_and_auth_url() method.
If not you will need need to extract the auth_verifier parameter from your callback url on the site where you are implementing 3-legged auth in order to pass it to this function.
The access token can be stored and re-used for subsequent calls.
The stored token will also need to be refreshed periodically with refresh_token()
First step is to get the token and then send the request that provides the auth URL
Returns a tuple of token and the authorisation URL.
Get the the request url
Access Tokens only last for one hour from the point of being issued.
When a token has expired it needs to be refreshed this method takes an expired token and refreshes it.
token parameter can be either a token object or a token string.
A YQLObject is the object created as the result of a YQL query
The results count
The query diagnostics
The language
Pretty format the raw data
Pretty print the raw data
The YQL query
The query parameters of the uri used to call the YQL API
The raw data response
The query results dict
Get the list of rows
Results is a dict with one key but that key changes depending on the results This provides a way of getting at the rows list in an arbitrary way
The uri used to query the YQL API
Base class for storage
A simple filesystem based token store
Note: this is more intended as an example rather than something for heavy duty production usage.
Get a token from the filesystem
Build filepath
Write a token to file
Generic token storage