Advertisement
ewjoachim

Untitled

Jan 12th, 2014
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2.  
  3. import urllib
  4.  
  5. def citriq(params):
  6.     errors = "\n".join([
  7.         "Le paramètre {} est obligatoire".format(param)
  8.         for param in ("uid", "isbn") if param not in params
  9.     ])
  10.     if not errors:
  11.         return '<script type="text/javascript" src="http://citriq.net/w/crawl?{}"><script>'.format(urllib.urlencode(params))
  12.     elif params.get("debug", 0) == 1 and errors:
  13.         print "Erreur Citriq : {}".format(errors);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement