summaryrefslogtreecommitdiff
path: root/searx/engines/flickr.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2015-05-02 15:45:17 +0200
committerAlexandre Flament <alex@al-f.net>2015-05-02 15:45:17 +0200
commit4689fe341ca7c7231d0409526b9ee0f2eadde445 (patch)
tree12d51f3471b2dfd448768cb8e540ee4668869453 /searx/engines/flickr.py
parentbbd83f5a519381ac7ea690a1645258d106a9ba8a (diff)
downloadsearxng-4689fe341ca7c7231d0409526b9ee0f2eadde445.tar.gz
searxng-4689fe341ca7c7231d0409526b9ee0f2eadde445.zip
update versions.cfg to use the current up-to-date packages
Diffstat (limited to 'searx/engines/flickr.py')
-rw-r--r--searx/engines/flickr.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/searx/engines/flickr.py b/searx/engines/flickr.py
index 4040236e1..68d45bc17 100644
--- a/searx/engines/flickr.py
+++ b/searx/engines/flickr.py
@@ -1,15 +1,17 @@
#!/usr/bin/env python
-## Flickr (Images)
-#
-# @website https://www.flickr.com
-# @provide-api yes (https://secure.flickr.com/services/api/flickr.photos.search.html)
-#
-# @using-api yes
-# @results JSON
-# @stable yes
-# @parse url, title, thumbnail, img_src
-#More info on api-key : https://www.flickr.com/services/apps/create/
+"""
+ Flickr (Images)
+
+ @website https://www.flickr.com
+ @provide-api yes (https://secure.flickr.com/services/api/flickr.photos.search.html)
+
+ @using-api yes
+ @results JSON
+ @stable yes
+ @parse url, title, thumbnail, img_src
+ More info on api-key : https://www.flickr.com/services/apps/create/
+"""
from urllib import urlencode
from json import loads
@@ -48,10 +50,10 @@ def response(resp):
search_results = loads(resp.text)
# return empty array if there are no results
- if not 'photos' in search_results:
+ if 'photos' not in search_results:
return []
- if not 'photo' in search_results['photos']:
+ if 'photo' not in search_results['photos']:
return []
photos = search_results['photos']['photo']