Skip to content

Commit

Permalink
Print out tweets for the last five events after a successful run
Browse files Browse the repository at this point in the history
  • Loading branch information
rradczewski committed Sep 24, 2018
1 parent 2331fbf commit 1efd9f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
language: node_js
cache: yarn

after_success: ./scripts/print_welcome_tweet.sh
14 changes: 14 additions & 0 deletions scripts/print_welcome_tweet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

DIRECTORY="_data/events_gdcr2018"
FILES=$(ls $DIRECTORY/*.json)

LAST_5_EVENTS=$(for i in $FILES; do git --no-pager log --diff-filter=A --follow --format="%at $i" -- $i | tail -1; done | sort | tail -n 5 | awk '{ print $2 }')

echo "Here are tweetable welcome messages for the latest five events registered (as per git)"
echo ""

for j in $LAST_5_EVENTS;
do
jq -r '"Welcome \"" + .title + "\" with " + (.moderators | join(", ")) + " in " + .location.city + ", " + .location.country + " to #gdcr18! See the link for more information " + .url' $j;
done

0 comments on commit 1efd9f2

Please sign in to comment.