def dictionary_from_api(): return json.loads( connect(my_json=make_dictionary(), endpoint=CHALLENGE_ENDPOINT))
def validate_prefix(): connect(my_json=make_dictionary('array', get_non_prefix(dictionary_from_api())), endpoint=VALIDATE_PREFIX_ENDPOINT)
def validate_needle(): connect(my_json=make_dictionary('needle', get_needle(dictionary_from_api())), endpoint=VALIDATE_HAYSTACK_ENDPOINT)
def validate_reversal(): connect(my_json = make_dictionary('string', reverse(string_from_api())), endpoint = VALIDATE_REVERSE_ENDPOINT)
def string_from_api(): return connect(my_json = make_dictionary(), endpoint = CHALLENGE_ENDPOINT)
#AUTHOR: JIDE OMEKAM from interface_methods import connect, make_dictionary CONNECT_START = 'https://github.com/jomekam/code2040' CHALLENGE_ENDPOINT = "http://challenge.code2040.org/api/register" """Step 1: Connect to CODE2040 challenge endpoint and send the required data in JSON format. """ #Main line function for python files if __name__ == "__main__": #See interface_methods.py for more on how connect works to the given API connect(my_json=make_dictionary('github', CONNECT_START), endpoint=CHALLENGE_ENDPOINT)
def validate_date(): connect(my_json = make_dictionary('datestamp', check_date(dictionary_from_api())), endpoint = VALIDATE_DATE_ENDPOINT)