its-wednesday

command module
v0.0.0-...-6483dc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

README

Captain, it's Wednesday!

This tiny script automated that reminds me when it's Wednesday and asks me if I want to tweet this meme:

It only asks, at maximum, once in the morning, once in the afternoon and once on the evening — and it stops asking when it has already tweeted in any given Wednesday.

Requirements

  1. Make sure you have Go 1.16 (or newer)
  2. Right now, go-twitter doesn't have all we need, so we're using a local branch to compile:
    1. Clone go-twitter to the parent directory (one level up from this repo's directory)
    2. Git pull drswork's branch there

Once this PR is merged, everything will be way easier.

Also I have not tested in Windows.

Basic usage

  1. Create an application and get your API keys from Twitter's Developer platform
  2. Create environment variables with the keys:
    • WEDNESDAY_CONSUMER_KEY
    • WEDNESDAY_CONSUMER_SECRET
    • WEDNESDAY_ACCESS_TOKEN
    • WEDNESDAY_ACCESS_TOKEN_SECRET
  3. Run with go run main.go cache.go

How I use it (opinionated)

I integrated in a way that when it's Wednesday my computer asks me if I want to tweet the meme.

First, I have generated the binary in a directory that is already in my PATH, for example:

go build -o /usr/local/bin/it-wednesday

Then I call this program for every new terminal session. In my case, I Fish, so I added this block to my .config/fish/config.fish:

set -x WEDNESDAY_CONSUMER_KEY …
set -x WEDNESDAY_CONSUMER_SECRET … 
set -x WEDNESDAY_ACCESS_TOKEN …
set -x WEDNESDAY_ACCESS_TOKEN_SECRET …
its-wednesday

If you use Bash or Zsh, feel free to send a PR with compatible instructions :)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL