Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpup/dbps
Go library for creating Dropbox backed photo sites.
https://github.com/dpup/dbps
Last synced: 24 days ago
JSON representation
Go library for creating Dropbox backed photo sites.
- Host: GitHub
- URL: https://github.com/dpup/dbps
- Owner: dpup
- License: other
- Created: 2015-07-26T00:35:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T19:39:22.000Z (almost 7 years ago)
- Last Synced: 2023-03-11T21:18:12.270Z (over 1 year ago)
- Language: Go
- Size: 1.67 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DBPS
A Go library for creating Dropbox backed photo sites.
The library queries a Dropbox folder for files, caches images in memory, and
polls for new images. HTTP Handlers are provided to serve the image files and to
return a list of photos as JSON (ordered by EXIF created at time).This is used by a couple of my sites. It is not supported and offered as-is.
Example
-------```go
package mainimport (
"log"
"net/http""github.com/dpup/dbps"
)func main() {
p := dbps.NewPhotoSite(dbps.Config{
DropBoxClientID: "[redacted]",
DropBoxClientSecret: "[redacted]",
DropBoxAccessToken: "[redacted]",
PhotoFolder: "Photos/my-portfolio",
})http.Handle("/photos.json", p.DataHandler)
http.Handle("/photos/", http.StripPrefix("/photos/", p.PhotoHandler))
http.Handle("/thumbnails/", http.StripPrefix("/thumbnails/", p.ThumbnailHandler))log.Fatal(http.ListenAndServe(":8080", nil))
}
```Generate tokens using Dropbox's [App Console](https://www.dropbox.com/developers/apps).
Contributing
------------
This is not really intended for mass use, but if you do have questions,
comments, bug reports, and pull requests please submit them
[on the project issue tracker](https://github.com/dpup/dbps/issues/new).License
-------
Copyright 2015 [Daniel Pupius](http://pupius.co.uk). Licensed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).