<s> import sys <EOL> import snapchat <EOL> def send_to ( username , password , recipient , fname ) : <EOL> with open ( fname ) as f : <EOL> data = f . read ( ) <EOL> connection = snapchat . Snapchat ( username , password ) <EOL> connection . connect ( ) <EOL> media_id = connection . upload ( data , snapchat . Snap . Type . IMAGE ) <EOL> connection . send_to ( recipient , media_id , snapchat . Snap . Type . IMAGE ) <EOL> connection . update ( ) <EOL> snap = filter ( lambda snap : isinstance ( snap , snapchat . SentSnap ) and snap . client_id . startswith ( media_id ) , connection . snaps ) [ <NUM_LIT:0> ] <EOL> print "<STR_LIT>" % ( snap . id , snap . id [ : - <NUM_LIT:1> ] + '<STR_LIT:r>' ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> username = sys . argv [ <NUM_LIT:1> ] <EOL> password = sys . argv [ <NUM_LIT:2> ] <EOL> recipient = sys . argv [ <NUM_LIT:3> ] <EOL> fname = sys . argv [ <NUM_LIT:4> ] <EOL> send_to ( username , password , recipient , fname ) </s>
