Skip to content

Instantly share code, notes, and snippets.

@arbalest
Created April 24, 2016 02:22
Show Gist options
  • Save arbalest/a0961729aacc3d5b7d7121a66db60302 to your computer and use it in GitHub Desktop.
Save arbalest/a0961729aacc3d5b7d7121a66db60302 to your computer and use it in GitHub Desktop.
from urllib import request
def downloadList():
req_url = "http://www.armitunes.com/lib-request_transition.php?sEcho=19&iColumns=5&sColumns=&iDisplayStart=" + str(display_start) + "&iDisplayLength=" + str(display_length) + "&mDataProp_0=0&mDataProp_1=1&mDataProp_2=2&mDataProp_3=3&mDataProp_4=4&sSearch=&bRegex=false&sSearch_0=&bRegex_0=false&bSearchable_0=false&sSearch_1=&bRegex_1=false&bSearchable_1=true&sSearch_2=&bRegex_2=false&bSearchable_2=true&sSearch_3=&bRegex_3=false&bSearchable_3=true&sSearch_4=&bRegex_4=false&bSearchable_4=false&iSortCol_0=1&sSortDir_0=asc&iSortingCols=1&bSortable_0=true&bSortable_1=true&bSortable_2=true&bSortable_3=true&bSortable_4=true&_=1461438259980"
response = request.urlopen(req_url);
res_output = response.read()
f = open("log_" + str(entry_start) + "_to_" + str(entry_end) + ".json", "ab")
f.write(res_output)
print("All done!")
# Get parameters
display_start = 0 # 0, 10, 20, etc.
display_length = 100
loop_count = 3
for i in range(loop_count):
entry_start = (display_start * i) + 1
entry_end = display_start + display_length
print(i, ": entry_start =", entry_start, "entry_end =", entry_end, "display_start =", display_start)
display_start += display_length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment