V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Dropbox - Simplify your life
注册 Dropbox
Dropbox for Developers
for4
V2EX  ›  Dropbox

Dropbox免费帐号的 `无限制` 历史版本

  •  
  •   for4 · 2013-10-07 02:49:48 +08:00 · 3397 次点击
    这是一个创建于 4169 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用空间换来的 :)

    #!/usr/bin/env python
    #-*- coding: utf-8 -*-
    # author: 8e5b93f51a63cb6dc7c4db564434e3150c9e67f34e85dfac87c20b6ed19b76ab
    import os, time
    from dropbox.client import DropboxClient
    from dropbox.client import DropboxOAuth2FlowNoRedirect
    app_key = 'mask'
    app_secret = 'mask'
    def main():
    if not os.path.exists('token.txt'):
    flow = DropboxOAuth2FlowNoRedirect(app_key, app_secret)
    print '1. Go to: ' + flow.start()
    print '2. Click "Allow" (you might have to log in first)'
    print '3. Copy the authorization code.'
    code = raw_input("Enter the authorization code here: ").strip()
    access_token, user_id = flow.finish(code)
    open('token.txt', 'w').write(access_token)
    client = DropboxClient(open('token.txt').read())
    res = client.file_copy('/encrypted', time.strftime('/history/%Y-%m-%d %H.%M.%S'))
    print 'Success: "%s"' % res['path']
    raw_input('Press Enter To Exit.')
    if __name__ == '__main__':
    main()
    view raw gistfile1.py hosted with ❤ by GitHub
    6 条回复    1970-01-01 08:00:00 +08:00
    for4
        1
    for4  
    OP
       2013-10-07 02:53:25 +08:00
    ~~~~~~~~~~~~~~换个数字~~~~~~~~~~
    for4
        2
    for4  
    OP
       2013-10-07 02:53:46 +08:00
    ~~~~~~~~~~~~~换个数字~~~~~~~~~~
    for4
        3
    for4  
    OP
       2013-10-07 02:53:52 +08:00
    ~~~~~~~~~~~~换个数字~~~~~~~~~~
    orzfly
        4
    orzfly  
       2013-10-07 03:05:15 +08:00
    Suggestion: 在自己服务器上跑这个脚本(比如 10 分钟一次),让他定时检查文件是否被修改了,一旦被修改就复制。
    mongodb
        5
    mongodb  
       2013-10-07 09:30:12 +08:00
    造轮子果然是人类取悦自己的好方法 -___-
    yangg
        6
    yangg  
       2013-10-07 12:37:37 +08:00
    有空间可以用inotify+git自动提交,这样查看起来也方便
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2745 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:46 · PVG 20:46 · LAX 04:46 · JFK 07:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.