Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 36 lines (29 sloc) 0.704 kb
46ac6e82 » Zach Tatlock
2012-03-10 init
1 #!/usr/bin/env bash
2
3 ROOT="/PATH/TO/THIS/DIR"
4 USER="EMAIL"
5 PASS="PASSWORD"
6 GRUP="http://FOO.tumblr.com/"
7 BLOG="http://FOO.blogspot.com"
8
9 #####
10
11 FORM="http://terrymhung.com/jtran/tumblr/import-blogger-to-tumblr.php"
12 FEED="$BLOG/feeds/posts/default?max-results=1"
13
14 cd $ROOT
15 touch OLD
16 curl -s $FEED > NEW
17 date >> log
18
02efb770 » Zach Tatlock
2012-03-13 crudely detect and handle 503 errors
19 if grep "Error 503" NEW > /dev/null; then
20 echo "* RSS DOWN!" >> log
21 rm NEW
22 exit 1
23 fi
24
46ac6e82 » Zach Tatlock
2012-03-10 init
25 if ! diff OLD NEW > /dev/null; then
26 echo "* UPDATE!" >> log
27 cp NEW "$(date +%y%m%d-%H%M).rss"
28 curl -s \
29 --data-urlencode "email=$USER" \
30 --data-urlencode "password=$PASS" \
31 --data-urlencode "group=$GRUP" \
32 --data-urlencode "feed=$FEED" \
33 $FORM > /dev/null
34 fi
35
36 mv NEW OLD
Something went wrong with that request. Please try again.