Skip to content

dpup/dbps

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

package main

import (
  "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.

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.

License

Copyright 2015 Daniel Pupius. Licensed under the Apache License, Version 2.0.

About

Go library for creating Dropbox backed photo sites.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages