From 3c5bb677cf395a68dff21e8b8e80a67f3aa462b8 Mon Sep 17 00:00:00 2001 From: Joe Catera Date: Fri, 19 Oct 2012 10:24:59 -0700 Subject: [PATCH 1/2] Added a placeholder for the API key and modified query. --- docs/dev_guide/code_exs/binding_events.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/dev_guide/code_exs/binding_events.rst b/docs/dev_guide/code_exs/binding_events.rst index 8a24d8940..f8722ede9 100644 --- a/docs/dev_guide/code_exs/binding_events.rst +++ b/docs/dev_guide/code_exs/binding_events.rst @@ -741,6 +741,16 @@ To set up and run ``binding_events``: .. code-block:: javascript YUI.add('PagerMojitBinder', function(Y, NAME) { + var API_KEY = '{your_api_key}'; + function parseImageId(link) { + var matches = link.match(/com\/(\d+)\/(\d+)_([0-9a-z]+)\.jpg$/); + return matches[2]; + } + function parsePage(link) { + var matches = link.match(/page=(\d+)/); + return matches[1]; + } + /** * The PagerMojitBinder module. * @module PagerMojitBinder @@ -828,14 +838,6 @@ To set up and run ``binding_events``: thatNode.all('#nav a').on('click', flipper, this); } }; - function parseImageId(link) { - var matches = link.match(/com\/(\d+)\/(\d+)_([0-9a-z]+)\.jpg$/); - return matches[2]; - } - function parsePage(link) { - var matches = link.match(/page=(\d+)/); - return matches[1]; - } }, '0.0.1', {requires: ['yql', 'io', 'dump']}); #. To display links to photos and associated photo data in the rendered template, replace the code From f0af949af8d30a6372fa32fc821eb059c36338c9 Mon Sep 17 00:00:00 2001 From: Joe Catera Date: Fri, 19 Oct 2012 10:27:42 -0700 Subject: [PATCH 2/2] Updated query. --- docs/dev_guide/code_exs/binding_events.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev_guide/code_exs/binding_events.rst b/docs/dev_guide/code_exs/binding_events.rst index f8722ede9..e6504a58e 100644 --- a/docs/dev_guide/code_exs/binding_events.rst +++ b/docs/dev_guide/code_exs/binding_events.rst @@ -811,7 +811,7 @@ To set up and run ``binding_events``: Y.log('IMAGE ID: ' + imageId); target.addClass('overlayed'); // Query for the image metadata - var query = 'select * from flickr.photos.info where photo_id="' + imageId + '"'; + var query = 'select * from flickr.photos.info where photo_id="' + imageId + '" and api_key="' + API_KEY + '"'; thatNode.one('#display').setContent('Loading ...'); Y.YQL(query, function(raw) { if (!raw.query.results.photo) {