Skip to content
/ pirem Public

bash wrapper script to fetch data from google-calendar and distribute it by mail, twitter, wiki

Notifications You must be signed in to change notification settings

markgraf/pirem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

bash wrapper script to fetch data from google-calendar and distribute it by mail, twitter, wiki

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published