Fixup titles of Pinboard-bookmarked github repos
The page titles that github produces suck. The repo's description is much more useful. This script walks through all your Pinboard bookmarks that point to a github repo and updates its title to be of the form:
<project name>: <project description>
- Fetch all pinboard bookmarks that point to github
- Build the canonical title from the github project title and its description
- Update the pinboard bookmark with the canonical title
Set your github.com credentials in
.netrcor any other of the ways supported by octokit.rb.
Get the API token from the Pinboard password page and set it as environment variable.
$ export PINBOARD_API_TOKEN=********
Run the tool:
$ bundle exec exe/pinboard-fixup-github-titles
The tool will read your github credentials from
An automated build on the docker hub creates a new image tagged with
latest upon a git push.
Optionally, you can build the image manually:
# Build and tag as the latest version of the image $ docker build --tag nerab/pinboard-fixup-github-titles:latest .
Generate the run helper
Generate the deployment script:
scripts/generate-deployment-script > scripts/run.sh
If desired, you may run the container manually:
$ docker run \ --env PINBOARD_API_TOKEN=******** \ --env GITHUB_ACCESS_TOKEN=******** \ --name pinboard-fixup-github-titles \ nerab/pinboard-fixup-github-titles
Change the environment variables to suit your preferences. The following environment variables are evaluated (in ascending order of preference):
NETRC_FILE(not useful for docker deployments)
Start the container
Run the previously generated
scripts/run.sh. This will generate a new container from the image and execute the
pinboard-fixup-github-titles tool once. The container will then stop.
In order to run the tool regularly, copy the cron script
/etc/cron.hourly/, e.g. with
docker-machine scp scripts/cronjob nr-docker:/etc/cron.hourly/pinboard-fixup-github-titles
The environment variables were passed when running the container for the first time, so there is no need to pass them to
docker start again.
A container will not print its console messages to where it was started from. If you want to follow the execution, use
$ docker logs -f pinboard-fixup-github-titles
Update the container
docker pull nerab/pinboard-fixup-github-titles # This will fail in most cases because the container is only running once an hour docker stop nerab/pinboard-fixup-github-titles docker rm nerab/pinboard-fixup-github-titles ./scripts/run.sh