Skip to content

Instantly share code, notes, and snippets.

@yask123
Created December 18, 2016 07:45
Show Gist options
  • Save yask123/3cf849c57252a8be4dd10ce8ae678419 to your computer and use it in GitHub Desktop.
Save yask123/3cf849c57252a8be4dd10ce8ae678419 to your computer and use it in GitHub Desktop.
import requests
cookies = {
'hackerrankx_mixpanel_token': '272ea07a-d083-46b9-959b-87ae1fc57b2c',
'hackerrank_mixpanel_token': '8540fec9-da7b-477f-8ef3-843b64c89215',
'optimizelyEndUserId': 'oeu1472732675307r0.5341516336263654',
'codeagon_crp': '*nil*',
'interstate_v2_efa8dff896d3b51999c6e1eae8719e46b2a36441': '%7B%22user_identifier%22%3A%22289b727b-fb40-4d2b-b8bc-b34b542894c1%22%2C%22last_updated%22%3A1472732677134%2C%22utm_campaign%22%3Anull%2C%22utm_source%22%3Anull%2C%22utm_medium%22%3Anull%2C%22utm_term%22%3Anull%2C%22utm_content%22%3Anull%2C%22last_visit%22%3A1474147499833%7D',
'enableIntellisenseUserPref': 'true',
'booking-com-passions-hacked-frontend_crp': '*nil*',
'_biz_flagsA': '%7B%22Version%22%3A1%2C%22Mkto%22%3A%221%22%2C%22Frm%22%3A%221%22%7D',
'codesprint5_crp': '*nil*',
'zalando-codesprint_crp': '*nil*',
'walmart-codesprint-algo_crp': '*nil*',
'_hp2_id.undefined': '%7B%22userId%22%3A%225742314401238213%22%2C%22pageviewId%22%3A%227270854927959317%22%2C%22sessionId%22%3A%222552303066624526%22%2C%22identity%22%3Anull%2C%22trackerVersion%22%3A%223.0%22%7D',
'jointheflock_crp': '*nil*',
'adobe-codhers_crp': '*nil*',
'hrx_candidate': 'BAhJImR7InRlc3RfaGFzaCI6ImIzcHQ0cTEzdHEzIiwiZW1haWwiOiJ5YXNrMTIzQGdtYWlsLmNvbSIsImNyZWF0ZWRfYXQiOiIyMDE2LTExLTE4VDE0OjMwOjA1LjQwOVoifQY6BkVU--6f653714a47286dbeaac12f02a1418aec1c68b8c',
'mp_bcb75af88bccc92724ac5fd79271e1ff_mixpanel': '%7B%22distinct_id%22%3A%20%228540fec9-da7b-477f-8ef3-843b64c89215%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fdalimil.github.io%2F%22%2C%22%24initial_referring_domain%22%3A%20%22dalimil.github.io%22%2C%22%24search_engine%22%3A%20%22google%22%2C%22utm_source%22%3A%20%22hackerrank%22%2C%22utm_medium%22%3A%20%22email%22%2C%22utm_campaign%22%3A%20%22ctci-welcome-email%22%2C%22utm_content%22%3A%20%22tutorial-link%22%7D',
'mp_86cf4681911d3ff600208fdc823c5ff5_mixpanel': '%7B%22distinct_id%22%3A%20%22158139954ea91-0ff15d683b9551-13386c51-1fa400-158139954eb6b8%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fwww.hackerrank.com%2F%22%2C%22%24initial_referring_domain%22%3A%20%22www.hackerrank.com%22%2C%22utm_source%22%3A%20%22website%22%2C%22utm_medium%22%3A%20%22footer%22%2C%22utm_campaign%22%3A%20%22website%22%2C%22%24search_engine%22%3A%20%22google%22%7D',
'h_r': 'domains',
'h_l': '_default',
'h_v': '_default',
'hacker_editor_theme': 'light',
'mp_36cfc98842f47eba17d79df294c189f0_mixpanel': '%7B%22distinct_id%22%3A%20%22156e5b57ae0484-0aadb1634a7861-37657900-1fa400-156e5b57ae1491%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fcodepair.hackerrank.com%2Fpaper%2Fslhbvesyohtgvwohkuopdsgczarmycso%3Fb%3DeyJpbnRlcnZpZXdfaWQiOjIzMjA2NSwicm9sZSI6ImludGVydmlld2VyIiwic2hvcnRfdXJsIjoiaHR0cDovL2hyLmdzLzg1YjY1MiJ9%22%2C%22%24initial_referring_domain%22%3A%20%22codepair.hackerrank.com%22%7D',
'fileDownload': 'true',
'_hrank_session': '685017a03e759f7aefa50489f3b55e7eb0492e80e45f107a48f59939a9762aa79b5c39cda39023bf83df99872e78c4bb58c4e6e36fff25bb9e7dd2827680d602',
'session_id': '8530lqwh-1482046556882',
'optimizelySegments': '%7B%221709580323%22%3A%22false%22%2C%221717251348%22%3A%22gc%22%2C%221719390155%22%3A%22search%22%2C%222308790558%22%3A%22none%22%7D',
'optimizelyBuckets': '%7B%7D',
'default_cdn_url': 'd3keuzeb2crhkn.cloudfront.net',
'_hp2_id.547804831': '%7B%22userId%22%3A%221572565289672387%22%2C%22pageviewId%22%3A%227739048905903836%22%2C%22sessionId%22%3A%221695859248993251%22%2C%22identity%22%3Anull%2C%22trackerVersion%22%3A%223.0%22%7D',
'_hp2_ses_props.547804831': '%7B%22ts%22%3A1482046571411%2C%22d%22%3A%22www.hackerrank.com%22%2C%22h%22%3A%22%2Fwork%2Fcodepair%22%7D',
'_oklv': '1482046571684%2CYo2wBU8x9BTAU0Pp462110XeIJ3R0OEa',
'_okdetect': '%7B%22token%22%3A%2214820465759490%22%2C%22proto%22%3A%22https%3A%22%2C%22host%22%3A%22www.hackerrank.com%22%7D',
'olfsk': 'olfsk30035800351359154',
'_okbk': 'cd4%3Dtrue%2Cvi5%3D0%2Cvi4%3D1482046577385%2Cvi3%3Dactive%2Cvi2%3Dfalse%2Cvi1%3Dfalse%2Ccd8%3Dchat%2Ccd6%3D0%2Ccd5%3Daway%2Ccd3%3Dfalse%2Ccd2%3D0%2Ccd1%3D0%2C',
'_ok': '3878-630-10-2684',
'wcsid': 'Yo2wBU8x9BTAU0Pp462110XeIJ3R0OEa',
'hblid': 'ysfODJxOB4mzh2Fg462119Z5JJM3E0R6',
'__utmt': '1',
'__utma': '74197771.1000513959.1472310708.1479990389.1482046580.65',
'__utmb': '74197771.1.10.1482046580',
'__utmc': '74197771',
'__utmz': '74197771.1479475525.60.25.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided)',
'_biz_uid': 'd34307af00fe48c89a9d2db723118d42',
'_biz_sid': '1e761e',
'_biz_nA': '370',
'_biz_pendingA': '%5B%5D',
'_mkto_trk': 'id:487-WAY-049&token:_mch-hackerrank.com-1472236178139-80526',
'mp_dcd74fdb7c65d92ce5d036daddac0a25_mixpanel': '%7B%22distinct_id%22%3A%20%22272ea07a-d083-46b9-959b-87ae1fc57b2c%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fwww.quora.com%2Fabout%2Fchallenges%22%2C%22%24initial_referring_domain%22%3A%20%22www.quora.com%22%2C%22%24search_engine%22%3A%20%22google%22%7D',
'mp_mixpanel__c': '1',
}
headers = {
'Pragma': 'no-cache',
'X-NewRelic-ID': 'VgIDVlRWGwICXVNXAgk=',
'Origin': 'https://www.hackerrank.com',
'Accept-Encoding': 'gzip, deflate, br',
'X-CSRF-Token': 'nrI0Gt2Wl4iRmq7YLGXr5lQUiAEytGBLnpfRuQP5mWo=',
'Accept-Language': 'en-US,en;q=0.8',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36',
'Accept': '*/*',
'Cache-Control': 'no-cache',
'X-Requested-With': 'XMLHttpRequest',
'Connection': 'keep-alive',
'Referer': 'https://www.hackerrank.com/work/codepair',
'Content-Length': '0',
}
url = requests.post('https://www.hackerrank.com/x/codepair', headers=headers, cookies=cookies).content
import json
import webbrowser
url = json.loads(url)['data']['interviewer_url']
webbrowser.open(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment