<s> import urllib <EOL> import urllib2 <EOL> import json <EOL> import argparse <EOL> api = { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> def getLink ( service , url ) : <EOL> terms = urllib . quote_plus ( url . strip ( ) ) <EOL> url = service + terms <EOL> data = urllib2 . urlopen ( url ) . read ( ) <EOL> return data <EOL> def main ( ) : <EOL> parser = argparse . ArgumentParser ( description = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT:url>" , <EOL> help = "<STR_LIT>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" , action = "<STR_LIT:store_true>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" , action = "<STR_LIT:store_true>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" , action = "<STR_LIT:store_true>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" , action = "<STR_LIT:store_true>" ) <EOL> parser . add_argument ( "<STR_LIT:-c>" , "<STR_LIT>" , <EOL> help = "<STR_LIT>" , action = "<STR_LIT:store_true>" ) <EOL> parser . add_argument ( "<STR_LIT>" , "<STR_LIT>" , action = '<STR_LIT:version>' , version = '<STR_LIT>' ) <EOL> args = parser . parse_args ( ) <EOL> url = args . url <EOL> if ( ( '<STR_LIT:http>' in url ) == False ) : <EOL> url = '<STR_LIT>' + url <EOL> if args . jmp : <EOL> service = api [ '<STR_LIT>' ] <EOL> output = json . loads ( getLink ( service , url ) ) [ "<STR_LIT:data>" ] [ "<STR_LIT:url>" ] <EOL> elif args . tcn : <EOL> service = api [ '<STR_LIT>' ] <EOL> output = json . loads ( getLink ( service , url ) ) [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] <EOL> elif args . isgd : <EOL> service = api [ '<STR_LIT>' ] <EOL> output = json . loads ( getLink ( service , url ) ) [ "<STR_LIT>" ] <EOL> elif args . vgd : <EOL> service = api [ '<STR_LIT>' ] <EOL> output = json . loads ( getLink ( service , url ) ) [ "<STR_LIT>" ] <EOL> elif args . tinycc : <EOL> service = api [ '<STR_LIT>' ] <EOL> output = json . loads ( getLink ( service , url ) ) [ "<STR_LIT>" ] [ "<STR_LIT>" ] <EOL> else : <EOL> service = api [ '<STR_LIT>' ] <EOL> output = json . loads ( getLink ( service , url ) ) [ "<STR_LIT:data>" ] [ "<STR_LIT:url>" ] <EOL> if ( output != '<STR_LIT>' ) : <EOL> print output <EOL> else : <EOL> print '<STR_LIT>' <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
