Created
June 10, 2016 15:17
-
-
Save rohieb/0d3cd157bb4a2e04fd922d7997f25cd9 to your computer and use it in GitHub Desktop.
copy etherpad contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PADURL='https://pad.stratum0.org/p' | |
APIURL='https://pad.stratum0.org/api/1' | |
APIKEY=FIXME_FILL_THIS_IN | |
template_pad=stratumnews-template | |
target_pad=sandkastennonexistent ## FIXME: change this to your needs. | |
urlescape() { | |
perl -MURI::Escape -e 'while(<STDIN>){print uri_escape($_)};' | |
} | |
template_text=$(curl $PADURL'/'$template_pad'/export/txt' | urlescape) | |
curl $APIURL'/createPad?apikey='$APIKEY'&padID='$target_pad | |
curl $APIURL'/setText?apikey='$APIKEY'&padID='$target_pad'&text='$template_text | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment