-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
91 lines (67 loc) · 3.85 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pirem.sh
========
pirem.sh is a wrapper script to pull data out of a google calendar and distribute
the data this by twitter, mail and wiki-entries.
It uses a slightly modded version of gcalcli for the pulling part,
ttytter to send tweets, /bin/mail to send mail and lynx to poke a wikibot.
--help
======
USAGE: ./pirem.sh -[hCDNVcuptw] <parameters>
This script is meant to be run as a cronjob, daily at 00:30.
Maybe you want to run in on Friday 23:30 with the -w option, too.
Settings are done in __init , but you can pass some as options:
OPTIONS:
-h --help
Print this usage-message and exit
-C --config <path>
Set alternate /path/to/config-file. Use '-C' as the first of
your options, to avoid further opts being overwritten.
-D --debug
Print debug-info during execution.
-N --noop
Do not send any tweets, mails...; aka 'dry-run'.
-V --version
Print version-information and exit.
-c --cal <name>
Select your google-calendar by name. If not set, will use 'default'.
-u --user <user>
Your google-username.
-p --password <path>
The path to your base64-coded password-file.
-r --mailrc=<path>
Path to rcfile for /usr/bin/mail
-t --ttytterauth
Name the keyfile for ttytter.
-w --weekly
Send an agenda of next weeks events.
FORMAT OF CALENDAR-ENTRIES
Calendar entries need to start with a short paragraph to be tweeted,
followed by an empty line and an optional more detailed description.
BEFORE YOU RUN IT THE FIRST TIME
set up /etc/pirem/pirem.conf or an alternate conf to pass with -C
set up ttytter
set up your google-calender, of course...
set up /etc/at.allow and /etc/cron.allow
gcalcli-pirem
=============
In order to avoid conflicts with the official gcalcli
(see https://code.google.com/p/gcalcli/ ), I keep a renamed copy here.
The only modification so far is that my version acceptis the option '--skript'
and the "agenda" command produces tab-seperated output if this option is given.
The modifications to gcalcli-2.1 were mostly done through try and error.
I've never written any python before that. It's working,
but it's surely not as elegant as it could be.
wikibot
========
The wikibot part is located in /var/www/pirem, is written in PHP and uses the
Wikibot class made by Jarry1250. The original class can be found here:
http://en.wikipedia.org/wiki/User:LivingBot/Wikibot.php5
This version has some minor modifications, e.g. it uses HTTP 1.0 as the
MediaWiki is only compatible with this version.
It expects a GET call on the /var/www/pirem/bot.php5 file as following:
bot.php5?date=...&time=...&location=...&title=...&content=...$botpassword=...
The configuration, e.g. which Template it should use, is stored in config.php5.
CONFIG
======
You need to add the pirem.sh-user to /etc/at.allow and /etc/cron.allow,
or the script will not work.