Puts an email to twitter with a link to the attached file, which will be stored locally
Python Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tmp
tweetfile_data
.gitignore
COPYING
README
do_keyword_expansion.sh
get_access_token.py
run_locally.sh
tweetfile.py
tweetfileaccess-template.py
watcher_report_output-template.sh

README

TweetFile
=========
Compose a Tweet from Mail


Overview
********
TweetFile is a pyton script for installation on your mail-enabled server.
When it receives a eMail, then subject line is transformed into a twitter message.
When the mail contains an attachment it is stored in the file system and a link is
attached to the twitter message.  
The content of the twitter message is also send per Mail to other reciptients.

Authorised users are only identified by their from address. Therefore select an
mail receiver adress which cannot be guessed.


Installation
************

You just need to call the program from the ~/.forward file
for the respective user which should deal with your mail requests.

Content of ~/.forward file:
 |"cd /home/<username>/tweetfile; TMP=/home/<username>/tweetfile/tmp FAKECHROOT_EXCLUDE_PATH=/dev:/usr/lib/python2.6:/usr/bin:/usr/share/perl:/usr/share/perl5:/usr/lib/perl:/home/<username>/tweetfile/tmp fakechroot ./watcher_report_output.sh 2>&1 >> watcher_report_output.log"

 /dev is required for SSL authentication, otherwise urllib2 fails with obscure error  
 /usr/bin and *perl* is required for exiftool  
 /home/<username>/tweetfile/tmp is required because twitter+tempfile creates temporary directories

If you don't like the fakechroot'ing you can comment off the block
"Go into CHROOT" in tweetfile.py

The script watcher_report_output.sh checks the execution of
tweetfile and generate an error mail in case of encountered errors.
In this case further execution of the program is prevented.
When you don't want to use this script then just remove it from the call.

To have some simple logfile rotation for watcher_report_output.sh
use the following crontab entry for the user (again adapt settings).
# Crontab-Entry for simple log archiving
# tweetfile: Simple Logfile cleaner: Every 2 weeks make one backup
24           2       11,21    *     *      cd $HOME/tweetfile; nice bzip2 -c watcher_report_output.log > watcher_report_output.log.bak.bz2 ; rm watcher_report_output.log



Configuration
*************

- Copy the file tweetfileaccess-template.py to tweetfileaccess.py
- Adapt the settings in tweetfileaccess.py
- Update UserList or add new user in tweetfileaccess.py
  - Twitter Configuration
    - Register tweetfile as a new app to your account
      - Login to
      	https://dev.twitter.com/apps/new
      - Name: tweetfile-<your account name>
      - Description: Tweet text and pictures via eMail
      - Website: https://github.com/sd2k9/tweetfile
      - Get Consumer key and Consumer secret from the next page
      - Go to settings, change Access to Read and Write
      - Create access token via button "Create my access token"
      	(must be done after previous step)
      	- Find them on the OAuth tool tab
- Hide from other users with the command
  chmod og-rw tweetfileaccess.py



License & Author
****************
GNU General Public License, version 2
Copyright (C) 2010 Robert Lange <sd2k9@sethdepot.org>

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2 as published by the Free Software Foundation.

http://www.gnu.org/licenses/old-licenses/gpl-2.0.html



Web Links
*********
Homepage
	https://sethdepot.org/site/SethdepotServices.html#Tweet_file

Repository
	https://github.com/sd2k9/tweetfile