diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 68 |
1 files changed, 48 insertions, 20 deletions
@@ -1,29 +1,57 @@ -# Michelangelo - A Tumblr Web Client -A quick and easy web client for Tumblr written in PHP to display pictures and videos in a pleasing gallery. +# Michelangelo -## Installation -1. To create a Tumblr application and get your consumer key/secret pair, [create an app on the Tumblr site](https://www.tumblr.com/oauth/apps). -2. Set your environment variables in an `.htaccess` file. For example, +A self-hosted Tumblr media client written in Go. Shows photos and videos from your dashboard in a true masonry grid. No ads, no tracking, no npm. -```env -# Environment Variables -SetEnv CONSUMER_KEY "<your-consumer-key>" -SetEnv CONSUMER_SECRET "<your-consumer-secret>" +## Features + +- True CSS masonry grid (variable-height, packed tight) +- Infinite scroll via IntersectionObserver +- Browse individual blogs in grid view (`/blog/<name>`) +- Tag search (`/search?q=<tag>`) +- Like and reblog from the lightbox +- Dark/light mode via `@media (prefers-color-scheme)` +- Zero external runtime dependencies (Go stdlib only) + +## Setup + +### 1. Create a Tumblr app + +Go to https://www.tumblr.com/oauth/apps and create an app. +Set the callback URL to `http://localhost:8080/auth/callback` (or your domain). + +### 2. Configure environment + +```sh +export CONSUMER_KEY="your-consumer-key" +export CONSUMER_SECRET="your-consumer-secret" +export PORT=8080 # optional, defaults to 8080 ``` -3. Add logic to your `.htaccess` file to ensure all URLs are processed by `index.php`. +Or use a `.env` file with a tool like `direnv`. -```conf -# Handle all paths and pages -# FallbackResource /index.php -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^ index.php [L] +### 3. Build and run + +```sh +go build -o michelangelo . +./michelangelo ``` -4. Git clone this repository into the web directory where you want the client to be served. -5. Done! You (and your users) can now login. The site will automatically redirect you to the Tumblr login page if you are not already authenticated. +Then open http://localhost:8080 — you'll be redirected to Tumblr to authorize. + +## Structure + +``` +main.go — HTTP router, OAuth flow, API proxy handlers +tumblr.go — Tumblr API client (OAuth 1.0a, no external deps) +templates/ + layout.html — Single HTML shell +static/ + app.css — Masonry grid, dark/light modes + app.js — Infinite scroll, lightbox, like/reblog +``` -### Gallery +## Notes - +- OAuth tokens are stored in cookies. Clear them or hit `/logout` to re-authenticate. +- The like/reblog endpoints use the Tumblr v1 API; reblogging posts to your own blog requires your blog name to be detected correctly on first auth. +- Tag search uses the `/tagged` endpoint which returns one batch (no pagination). |
