<s> class Shortie ( Service ) : <EOL> def __init__ ( self , email = None , secretkey = None ) : <EOL> self . email = email <EOL> self . secretkey = secretkey <EOL> def _test ( self ) : <EOL> self . email = raw_input ( '<STR_LIT>' ) <EOL> self . secretkey = raw_input ( '<STR_LIT>' ) <EOL> Service . _test ( self ) <EOL> def shrink ( self , bigurl , tag = None , private = False ) : <EOL> if self . email is None or self . secretkey is None : <EOL> raise ShortyError ( '<STR_LIT>' ) <EOL> parameters = { <EOL> '<STR_LIT:email>' : self . email , '<STR_LIT>' : self . secretkey , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:url>' : bigurl <EOL> } <EOL> if tag : <EOL> parameters [ '<STR_LIT>' ] = tag <EOL> if private : <EOL> parameters [ '<STR_LIT>' ] = '<STR_LIT:true>' <EOL> resp = request ( '<STR_LIT>' , parameters ) <EOL> jdata = json . loads ( resp . read ( ) ) [ '<STR_LIT>' ] <EOL> if jdata [ '<STR_LIT:error>' ] [ '<STR_LIT:code>' ] != <NUM_LIT:0> : <EOL> raise ShortyError ( jdata [ '<STR_LIT:error>' ] [ '<STR_LIT>' ] ) <EOL> return str ( jdata [ '<STR_LIT>' ] ) </s>
