Skip to content

Instantly share code, notes, and snippets.

@ijiraq
Created November 20, 2017 23:57
Show Gist options
  • Save ijiraq/1ad22eda4517ac6644dd13846de71408 to your computer and use it in GitHub Desktop.
Save ijiraq/1ad22eda4517ac6644dd13846de71408 to your computer and use it in GitHub Desktop.
def smoka_datarequest(frame_ids):
"""
Make a datarequest given a SMOKA frame id.
This is method is in here as an exmple for datalink service to follow.
:param frame_ids: list of frames to retrieve
:type frame_ids: list
:return: The content of the resulting POST to the smoka datarequest service.
"""
endpoint = """http://smoka.nao.ac.jp/datarequest"""
data = [('action', 'Datarequest'), ('search_type', '')]
for frame_id in frame_ids:
data.append(('frameinfo', frame_id))
return requests.post(endpoint, data=data).content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment