Skip to main content

Seach public pics on flicker

While blogging, I keep needing images that I can use. Though I have no issue using proprietary one from google, however it would be best if I could put flickr to some use and develop an app that searches the flickr.com and returns me images of my choice. It's jquery and JSOn that I have used. Thanks google!

here is the code


<!DOCTYPE html>
<html>
<head>
<style>img{ height: 100px; width: 100px; margin: 5px 5px 5px 5px; float: left; border: solid black}</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
function fetchJSON() {
var tag = document.getElementById('input');
// document.getElementByID("input");
$.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?",
   {
     tags: tag.value,
     tagmode: "any",
     format: "json"
   },function(data) {
   $.each(data.items, function(i,item){
       $('#images').append('<a href="'+item.media.m+'"><img src="'+item.media.m+'"></a>val='+i+'');
       //alert(item.media.m);
       //if ( i == 20 ) return false;
//if ( i == 19 ) fetchJSON();
       });
   });
  }
</script>

</head>
<body>
<input type="text" id='input'>
<input type="submit" value="GO" onclick="javascript:fetchJSON()">


<div id="images"></div>
</body>
</html>


TODO : simple UI tricks.
1. turn off the GO button once it is hit
2. make something like twistori.com with flickr images

Comments

Popular posts from this blog

सूनापन

मुद्दत हो गयी उन तन्हायियो को गुजरे , फिर भी इन आँखों में नमी क्यों है  ? तोड़ दिया मोहब्बत पर से यकीन मेरा, फिर भी मेरी दुनिया में तेरी कमी क्यों है ? हसरत है क्यों आज भी तेरी चाहत की मुझे, क्यों याद तेरी जेहेन से मिटती नहीं ? जलजला क्यों उमड़ता है ख्वाबो में मेरे, उस आशिकी की आगज़नी क्यों है  ? सन्नाटो में भी क्यों सुनता हू तुझे मेरी परछाई से क्यों तू जाती नहीं ? इन डबडबाती आँखों को तलाश तेरी, आज भी कहीं क्यों है   ?

How the Python import system works

How the Python import system works From:  https://tenthousandmeters.com/blog/python-behind-the-scenes-11-how-the-python-import-system-works/ If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like  ImportError: attempted relative import with no known parent package ; or tried to figure out how to structure a project so that all the imports work correctly; or hacked  sys.path  when you couldn't find a better solution. Every Python programmer experienced something like this, and popular StackOverflow questions, such us  Importing files from different folder  (1822 votes),  Relative imports in Python 3  (1064 votes) and  Relative imports for the billionth time  (993 votes), are a good indicator of that. The Python import system doesn't just seem complicated – it is complicated. So even though...

What does it mean to “shift testing left”?

What does it mean to “shift testing left”? I used to think shifting left meant starting all these testing activities earlier in the process, but I realise it is more than that: it means  doing different things . Shifting left on testing means thinking about architecture and design differently, considering different stakeholders early and continually. Which in turn means shifting left on security, accessibility, and all the other dimensions of quality that we should care about. So shifting left on testing motivates all kinds of assurance activities, which can stop us over-investing in a solution that was never going to work. It is like TDD on steroids. As an unintended consequence, we can remove much of the traditional work that testers would have to do downstream when they only have late sight of the product. Again, we aren’t doing that work earlier, we are setting ourselves up to never need it at all!