SHARE
TWEET

Untitled

ewjoachim Jan 12th, 2014 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
Top