Using the currently selected outline text as a tag, searches flicker and adds the first 5 images found below with the html returned.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var t = op.getLineText();; | |
var theurl = "https://api.flickr.com/services/feeds/photos_public.gne?tags=" + t + "&format=opml"; | |
http.readUrl(theurl, | |
function(data) { | |
xmlDoc = $.parseXML(data); | |
var ii = 0;; | |
$xml = $(xmlDoc), | |
$xml.find("entry").each(function() { | |
ii++; | |
if (ii > 5) { | |
return true; | |
}; | |
var kittenhtml = $(this).find("content").text();; | |
op.insert(string.replaceAll(string.replaceAll(trimWhitespace(kittenhtml), "<p>", ""), "</p>", ""), 'right'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment