Permalink
Browse files

Fix flickr querying mechanism.

  • Loading branch information...
1 parent dd6659b commit 486e7cae6d73a5d5d74d3bd789de2025a10a2964 @leenookx committed Sep 15, 2009
Showing with 485 additions and 2 deletions.
  1. +3 −0 app/controllers/flickr_controller.rb
  2. +2 −2 public/javascripts/flickr-utils.js
  3. +480 −0 public/javascripts/json2.js
@@ -11,6 +11,9 @@ def show
url = "http://api.flickr.com/services/feeds/photos_public.gne?tags=" + params[:id] + "&tagmode=any&format=json"
@flickr_data = open( url ).read
+ @flickr_data.gsub!(/^jsonFlickrFeed\(/,'')
+ @flickr_data.gsub!(/\)$/,'')
+
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @flickr_data }
@@ -19,8 +19,8 @@ function queryFlickr(keywords) {
function receiveFlickrResponse(results) {
if (results != "") {
showStatus("done.");
- var doc = JSON.parse(results);
- var result = doc['items'];
+ var jdoc = results.evalJSON();
+ var result = jdoc['items'];
var tmp = "";
var point = document.getElementById('flickr');
for (var i = 0; i < result.length; i++) {
Oops, something went wrong.

0 comments on commit 486e7ca

Please sign in to comment.