Skip to content

Instantly share code, notes, and snippets.

@sojw
Created November 16, 2022 06:15
Show Gist options
  • Select an option

  • Save sojw/c653f2a01bfb8a2951b0cce5a7a2e88b to your computer and use it in GitHub Desktop.

Select an option

Save sojw/c653f2a01bfb8a2951b0cce5a7a2e88b to your computer and use it in GitHub Desktop.

Revisions

  1. sojw created this gist Nov 16, 2022.
    21 changes: 21 additions & 0 deletions api_bulk_call.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    import requests, json, os

    def call_api(fid):

    url = 'https://www.naver.com/events'

    headers = {'X-d': fid}
    query = {'lat':'45', 'lon':'180'}

    response = requests.delete(url, headers=headers, params=query)
    return "{} : {}".format(fid, response.status_code)

    def main():
    target_list = []
    with open(os.getcwd() + "/work/test.txt","r") as f:
    for line in f.readlines():
    target_list.append(call_api(line.strip('\n')))
    print(target_list)

    if __name__ == "__main__":
    main()