list_actions

command
v0.0.0-...-f91b66c Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Unlicense Imports: 8 Imported by: 0

README

Fetch actions and convert to PDF

This app creates a bash shell that causes an application to read the contents of actions and then convert them to PDF. The application is a NodeJS app that leverates the puppeteer library. That's the only thing that I've found that does a nice, neat PDF with out a lot of empty pages at the top.

Installation

The app expects that hn.js is in the current directory and that the current directory is initialized properly to be both a Go and a NodeJS directory. Use these steps to make that happen.

Go
  1. Latest version of [Go](https://golang.org}.
  2. Correct directory structure.
HOME
  |
  + go
    |
    + bin
    + pkg
    + src
      |
      + github.com
        |
        + salsalabs
  1. Change the directory to salsalabs.
  2. Install this repository.
git clone https://github.com/salsalabs/godig
  1. Change the directory to godig.
  2. Install all Go dependencies.
go get ./...
  1. Build this application
go build -o list_events cmd/list_events
NodeJS

Execute these statements in the godig directory. This is important.

  1. Install Node Version Manager (NVM)
  2. Install the latest version of nvm in the current directory.
nvm install default
  1. Initialize to be a NodeJS package.
npm init #then tap the enter key a bunch of times
  1. Install the puppeteer library for NoeJS](https://github.com/GoogleChrome/puppeteer)
npm install --save puppeteer
Salsa
  1. Campaign manager credentials for the organization.
  2. Create a YAML file with the campaign manager credentials. We'll refer to this as whatever.yaml in this document.
  3. click here to find the hostname.
hostname: Salsa node name
email:  campaign manager's email address
password: campaign manager's password

Execution

  1. Run the Go app to create a bash script to retrieve actions.
./list_events --login whatever.yaml
  1. Run the script generated by the Go command.
bash fetch_actions.bash
  1. There may be errors. You'll have to fix those yourself.
  2. When the process is done, there will be a directory named pdfs/actions. It contains all of the action PDFs.

Notes

The scripts used to process actions are generated asynchronously. It's eally hard to find out where errors occur because of that.

Here is a bash scrap that sorts the list of actions by action_KEY.

sort -k 2 -n -t = fetch_actions.bash >xx.bash
mv xx.bash fetch_actions.bash

The sort splits the line into the stuff before and after the equal sign (-t =). The stuff to the right of the equal sign is the second field (-k 2), and it starts with the action_KEY, which is numeric (-n). Since the first part of the second half is being sorted numerically, action_KEYs that start in the 800's (for example) are sorted below the ones in the 20,000's. If the sort were a straight text sort, then the 800's would appear at the bottom.

If the script fails, then you can view the contents of pdf/actions to see how far along the script was. Make adjustments to the script and continue.

Questions?

Use the "Issues" link at the top of this repository to ask questions and report errors. Do not contact Salsalabs support. They are surly and bite-y during their nesting season. Use the "Issues" link. We'll be back in touch eventually.

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