https://github.com/bep/twittercard-proxy
Create pretty Twitter Cards for your GitHub releases etc.
https://github.com/bep/twittercard-proxy
go golang twitter-cards
Last synced: 8 months ago
JSON representation
Create pretty Twitter Cards for your GitHub releases etc.
- Host: GitHub
- URL: https://github.com/bep/twittercard-proxy
- Owner: bep
- License: mit
- Created: 2017-06-21T06:07:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-22T22:25:57.000Z (almost 9 years ago)
- Last Synced: 2025-04-02T21:08:12.889Z (about 1 year ago)
- Topics: go, golang, twitter-cards
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Twitter Card Proxy
[](https://travis-ci.org/bep/twittercard-proxy)
[](https://circleci.com/gh/bep/twittercard-proxy)
[](https://ci.appveyor.com/project/bep/twittercard-proxy)
[](https://godoc.org/github.com/bep/twittercard-proxy)
[](https://goreportcard.com/report/github.com/bep/twittercard-proxy)

The above screenshot is the single motivation behind this tool: To get [nicer looking](https://twitter.com/GoHugoIO/status/877500564405444608) Twitter cards when announcing GitHub-releases. GitHub provides some Twitter metadata, but it is for your account only, and just linking to the release page gets you a [rather blend](https://twitter.com/GoHugoIO/status/875629224228306944) Twitter card.
## Install
Download a binary from [releases](https://github.com/bep/twittercard-proxy/releases).
**twittercard-proxy** is a Go application, so you can also easiliy compile it yourself or intall it is via `go get`:
```bash
go get -v github.com/bep/twittercard-proxy
```
## Use
```bash
▶ ./twittercard-proxy -h
Usage of ./twittercard-proxy:
-f string
The JSON filename with twitter cards (default "./twittercards.json")
-http string
The HTTP listen address (default "0.0.0.0:1414"
```
To add or modify Twitter cards, just edit the `JSON` file and send a `SIGHUP` signal to the server process:
```bash
kill -s SIGHUP
```
## File format
The `id` below will become the path and `target` is the proxy target.
The rest are Twitter Card properties, see [https://dev.twitter.com/cards/types/summary-large-image](https://dev.twitter.com/cards/types/summary-large-image).
```json
[
{
"id": "hugo-0.24",
"site": "@GoHugoIO",
"creator": "@bepsays",
"image": "https://s11.postimg.org/jsd2aq1er/hugo-24-poster.png",
"title": "The Revival of the Archetypes!",
"description": "In the new Hugo 0.24, archetype files are Go templates with all funcs and the full .Site available, for all content formats.",
"target": "https://github.com/gohugoio/hugo/releases/tag/v0.24"
}
]
```