Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ The WordPress, Google, and Twitter related switches also require some custom
environment variables to be setup. For examples of those, see the
[publish.sh.example](publish.sh.example).

## Wrapping bash scripts

If you're on a machine that has bash available, there are a couple useful tools
in the `scripts/` folder. To configure them, copy the `publishing.cfg.example`
to `publishing.cfg`, make your changes, and then run the scripts (which wrap
the node code).

## Development

During development, you'll want to test with the working copy version of
Expand Down
40 changes: 0 additions & 40 deletions publish.sh.example

This file was deleted.

20 changes: 20 additions & 0 deletions publishing.cfg.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
#
# Example file for configuration options for publishing minutes

export EDITOR="/usr/bin/gedit"
export WAV_EDITOR="/usr/bin/audacity"
export NODE_COMMAND="nodejs"

export SCRAWL_EMAIL_USERNAME=
export SCRAWL_EMAIL_PASSWORD=
export SCRAWL_EMAIL_SERVER=
# Optional port and SSL. Default SSL is false
# export SCRAWL_EMAIL_PORT=
# export SCRAWL_EMAIL_SSL=
export SCRAWL_TWITTER_CONSUMER_KEY=
export SCRAWL_TWITTER_SECRET=
export SCRAWL_TWITTER_TOKEN_KEY=
export SCRAWL_TWITTER_TOKEN_SECRET=
export SCRAWL_LINKEDIN_CLIENT_ID=
export SCRAWL_LINKEDIN_CLIENT_SECRET=
83 changes: 83 additions & 0 deletions scripts/download-raw-minutes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/bin/sh
#
# Fetches the raw minutes for cleanup

display_usage() {
echo "Downloads raw minutes and audio for CCG group meetings."
echo ""
echo "Usage: ./download-raw-minutes [-lh] [-d date]"
echo " -d [YYYY-MM-DD] pass date argument"
echo " -l launch audio and video editors programmatically"
echo " -h display help"
echo ""
echo "Examples:"
echo ""
echo " ./download-raw-minutes"
echo " downloads raw minutes and audio for the current date"
echo ""
echo " ./download-raw-minutes -d 2018-05-15"
echo " downloads raw minutes and audio for 15 May 2018"
}
AUTO_LAUNCH=false
CREATE_DIRECTORY=true

for i in "$@"
do
case $i in
--)
display_usage
exit 0
;;
-h|--help)
display_usage
exit 0
;;
-l|--autolaunch)
AUTO_LAUNCH=true
shift
;;
-d|--date)
shift
DATE=$1
break
;;
esac
done

# Guess the date if it isn't set
if [ -z "$DATE" ]; then
DATE=`date +%Y-%m-%d`
echo "No date argument supplied; using $DATE"
fi

echo "....Downloading minutes for date=$DATE"
echo "....Auto launch setting=$AUTO_LAUNCH"

# Get the editor commands
source ../publishing.cfg

# Create the minutes directory if it doesn't already exist
mkdir -p $DATE

# Download raw logs and recordings
echo "....Downloading IRC logs for $DATE..."
curl -# "https://w3c-ccg.s3.digitalbazaar.com/minutes/$DATE-irc.log" > $DATE/irc.log
echo "....Downloading audio recording for $DATE..."
curl -# "https://w3c-ccg.s3.digitalbazaar.com/minutes/$DATE-audio.wav" > $DATE/audio-raw.wav

echo "Download is finished! To finalize the minutes, clean up the minutes/audio and publish."

if [ "$AUTO_LAUNCH" = true ]; then
# Edit the IRC log
$EDITOR $DATE/irc.log &

# Edit the audio recording
$WAV_EDITOR $DATE/audio-raw.wav &
fi

# Print out directions on finalizing minutes
echo " Instructions for editing minutes and audio:"
echo " https://github.com/w3c-ccg/w3c-ccg.github.io/blob/master/irc_ref.md#edit"
echo " Instructions for publishing:"
echo " https://github.com/w3c-ccg/w3c-ccg.github.io/blob/master/irc_ref.md#publishing"

92 changes: 92 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash
#
# Generates minutes for the directory given

#!/bin/sh
#
# Fetches the raw minutes for cleanup

display_usage() {
echo "Publish CCG minutes via email and social media."
echo ""
echo "Usage: ./publish [-h] [-d directory]"
echo " -d [/path/to/YYYY-MM-DD] pass directory"
echo " -h display help"
echo ""
echo "Examples:"
echo ""
echo " ./publish -d /path/to/w3c-ccg-meeting/2018-05-15"
echo " previews 2018-05-15 minutes and audio in preview mode (does not broadcast results)"
echo ""
}

if [ $# -eq 0 ]
then
display_usage
exit 1
else
for i in "$@"
do
case $i in
--)
display_usage
exit 0
;;
-h|--help)
display_usage
exit 0
;;
-d|--directory)
shift
DIRECTORY=$1
break
;;
esac
done
fi

echo "....Publishing minutes for directory=$DIRECTORY"

DATE="$(basename $DIRECTORY)"

source ../publishing.cfg

echo "Generating minutes and social media posts for $DATE"
MESSAGE="Add text minutes and audio logs for $DATE telecon."

# Add default values for missing env vars
if [ -z "$NODE_COMMAND" ]; then
NODE_COMMAND="nodejs"
fi

if [ -z "$SCRAWL_TO_EMAIL_ADDRESS" ]; then
SCRAWL_TO_EMAIL_ADDRESS="public-credentials@w3.org"
fi


# Generate minutes
$NODE_COMMAND index.js -d $DIRECTORY -m -i

# Make sure we want to continue
read -r -p "Check for problems, press 'y' when ready to commit to git, tweet/email: " BROADCAST

echo "Broadcast: $BROADCAST"

if [ "$BROADCAST" != "y" ]
then
echo "Aborting git commit and social media broadcast."
exit
fi

git add $DIRECTORY/irc.log $DIRECTORY/index.html $DIRECTORY/audio.ogg
git commit $DIRECTORY/irc.log $DIRECTORY/index.html $DIRECTORY/audio.ogg $DIRECTORY/../index.html -m "$MESSAGE"
git push

# Generate G+ post summary
# $NODE_COMMAND index.js -d $1 -w

# Email minutes
$NODE_COMMAND index.js -d $DIRECTORY -e

# Tweet telecon results
$NODE_COMMAND index.js -d $DIRECTORY -t