Skip to content

Instantly share code, notes, and snippets.

@mishadoff
Created June 16, 2014 11:23
Show Gist options
  • Save mishadoff/919ab09841e81005d6a2 to your computer and use it in GitHub Desktop.
Save mishadoff/919ab09841e81005d6a2 to your computer and use it in GitHub Desktop.
jopbox usage example
(:require [jopbox.client :as dbx])
(def *APP-KEY* "YOUR_APP_KEY")
(def *APP-SECRET* "YOUR_APP_SECRET")
;; make consumer and request token
(def consumer (dbx/make-consumer *APP-KEY* *APP-SECRET*))
(def request-token (dbx/fetch-request-token consumer nil))
;; generate authorization url
(def auth-url (dbx/authorization-url consumer request-token))
;; go to url and give permissions to facetrace for reading images and text files
;; access-token needed as well
(def access-token-response (dbx/fetch-access-token-response consumer request-token))
;; account meta, needed to check available disk space, filetype permissions, geo-info
(def account-info (dbx/account-info consumer access-token-response))
;; upload file, needed to sync local images with dropbox, modify facetrace metadata
(dbx/upload-file consumer
access-token-response
:dropbox
"image1.jpg"
"/home/mishadoff/Pictures/mishadoff_in_hat.jpg")
;; file metadata, modified date, dir
(dbx/metadata consumer access-token-response :dropbox "facetrace/meta.txt")
;; get file contents, preprocess meta tags, file names for building lapse
(dbx/get-file consumer access-token-response :dropbox "facetrace/meta.txt")
@Rounaldy
Copy link

Rounaldy commented Apr 2, 2018

This is a good thing that we can use this programme to share information between orders people

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment