Re: [Tutor] Downloading Slack Files

2016-08-28 Thread khalil zakaria Zemmoura
Just replace r.iter_content(...) By response.iter_content(...) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Downloading Slack Files

2016-08-28 Thread khalil zakaria Zemmoura
I noticed that you didn't store what requests downloaded in a new file you created. The usual pattern to use is to download a file and writing it to the HD drive. You have to create a file with "With open(file_name.extention, "wb") as f: " and write to that file. Here is the code that I suggest Wi

Re: [Tutor] Downloading Slack Files

2016-08-16 Thread Alan Gauld via Tutor
On 16/08/16 21:25, Malcolm Boone wrote: > I'm trying to run a python script that will download all files uploaded to > my companies Slack account from the past 30 days. I've no idea what a slack account is but I'm assuming some kind of web server... I've made a few general observations, I don;t

Re: [Tutor] Downloading Slack Files

2016-08-16 Thread David Rock
> On Aug 16, 2016, at 15:25, Malcolm Boone wrote: > > if __name__ == '__main__': >while 1: >files_list_url = 'https://slack.com/api/files.list' >date = str(calendar.timegm((datetime.now() + timedelta(-30)) >.utctimetuple())) >data = {"token": _token, "ts_t

[Tutor] Downloading Slack Files

2016-08-16 Thread Malcolm Boone
Hello everyone! I'm trying to run a python script that will download all files uploaded to my companies Slack account from the past 30 days. I'm new to Python, so to achieve this, I've just been editing a script that I use to delete all Slack files from the past 30 days. Here is the code I'm usin