The above screenshot is the single motivation behind this tool: To get nicer looking 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 Twitter card.
Download a binary from releases.
twittercard-proxy is a Go application, so you can also easiliy compile it yourself or intall it is via go get
:
go get -v github.com/bep/twittercard-proxy
▶ ./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:
kill -s SIGHUP <process-id>
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.
[
{
"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"
}
]