{"action":"created","issue":{"url":"https://api.github.com/repos/cantino/huginn/issues/713","labels_url":"https://api.github.com/repos/cantino/huginn/issues/713/labels{/name}","comments_url":"https://api.github.com/repos/cantino/huginn/issues/713/comments","events_url":"https://api.github.com/repos/cantino/huginn/issues/713/events","html_url":"https://github.com/cantino/huginn/pull/713","id":58497121,"number":713,"title":"Add support to dropbox_file_url_agent for permanent links","user":{"login":"bennlich","id":704368,"avatar_url":"https://avatars.githubusercontent.com/u/704368?v=3","gravatar_id":"","url":"https://api.github.com/users/bennlich","html_url":"https://github.com/bennlich","followers_url":"https://api.github.com/users/bennlich/followers","following_url":"https://api.github.com/users/bennlich/following{/other_user}","gists_url":"https://api.github.com/users/bennlich/gists{/gist_id}","starred_url":"https://api.github.com/users/bennlich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennlich/subscriptions","organizations_url":"https://api.github.com/users/bennlich/orgs","repos_url":"https://api.github.com/users/bennlich/repos","events_url":"https://api.github.com/users/bennlich/events{/privacy}","received_events_url":"https://api.github.com/users/bennlich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-02-22T09:48:31Z","updated_at":"2015-05-15T16:01:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cantino/huginn/pulls/713","html_url":"https://github.com/cantino/huginn/pull/713","diff_url":"https://github.com/cantino/huginn/pull/713.diff","patch_url":"https://github.com/cantino/huginn/pull/713.patch"},"body":"The dropbox urls returned by [a `/media` request](https://www.dropbox.com/developers/core/docs#media) only last a few hours. I added an option to the dropbox_file_url_agent to request [`/shares` urls](https://www.dropbox.com/developers/core/docs#shares), which last indefinitely. This takes advantage of the `?dl=1` query parameter, documented [here](https://www.dropbox.com/en/help/201).\r\n\r\nI also just came across [this method](http://techapple.net/2014/04/trick-obtain-direct-download-links-dropbox-files-dropbox-direct-link-maker-tool-cloudlinker/) of getting permanent links, which seems like it might be better, even though it isn't documented on the dropbox website. What do you think?"},"comment":{"url":"https://api.github.com/repos/cantino/huginn/issues/comments/102448173","html_url":"https://github.com/cantino/huginn/pull/713#issuecomment-102448173","issue_url":"https://api.github.com/repos/cantino/huginn/issues/713","id":102448173,"user":{"login":"cantino","id":83835,"avatar_url":"https://avatars.githubusercontent.com/u/83835?v=3","gravatar_id":"","url":"https://api.github.com/users/cantino","html_url":"https://github.com/cantino","followers_url":"https://api.github.com/users/cantino/followers","following_url":"https://api.github.com/users/cantino/following{/other_user}","gists_url":"https://api.github.com/users/cantino/gists{/gist_id}","starred_url":"https://api.github.com/users/cantino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cantino/subscriptions","organizations_url":"https://api.github.com/users/cantino/orgs","repos_url":"https://api.github.com/users/cantino/repos","events_url":"https://api.github.com/users/cantino/events{/privacy}","received_events_url":"https://api.github.com/users/cantino/received_events","type":"User","site_admin":false},"created_at":"2015-05-15T16:01:42Z","updated_at":"2015-05-15T16:01:42Z","body":"Oh, yes, that's exactly right.  Instead of making a new Object, use a new\nOpenStruct.  Then you can assign the URL on it for the spec directly\nwithout needing the second mock, and the real code can update it.\n\nOn Friday, May 15, 2015, Benny Lichtner <notifications@github.com> wrote:\n\n> Thanks, @cantino <https://github.com/cantino>. I tried that and I get:\n>\n> NoMethodError:\n>        undefined method `url=' for #<Object:0x007f9a718ff0f8>\n>\n> for this line:\n>\n> result.url = result.url.gsub('?dl=0','?dl=1') # cause the url to point to the file, instead of to a preview page for the file\n>\n> Is this because the url attribute of the mock is not writeable?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/cantino/huginn/pull/713#issuecomment-102433858>.\n>\n"}}