notifyfrndc.py A simple tool to get the queue of notifications from your friendica account onto your desktop. by Tobias Diekershoff mail: tobias.diekershoff(at)gmx.net friendica: tobias(at)diekershoff.homeunix.net All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the <organization> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Requirements: * a friendica (http://friendica.com) account * pynotify * friendika module for python2 bundled with this script or available at http://ur1.ca/7yhbb * tested with python 2.7 on Linux Configuration file: Run the install.sh file, which was kindly provided by Tony Baldwin, it will generate the needed config file asking you some questions about your account. Otherwise create the file by yourself. * location: $home/.notifyfrndc.cfg * example ----- begin example config file [account] api = http[s]://your.friendica.tld/api user = yourusername password = yourpassword [settings] timeout = 5 lookevery = 60 ----- end example config file The options timeout and lookevery should be integer values in seconds. timeout is the number of seconds the notification will be displayed. An additional second is added for every item in the queue to give you time to read it. The lookevery value is the time after which the program shall look for new items. Note it will only display the current state of the queue when (a) there are items and (b) the number of items since the last check has changed. How to install and run it? Put notifyfrndc.py and friendika.py in one directory (say $home/bin) and change the mode of notifyfrndc.py with "chmod +x notifyfrndc.py". Then execute that file or call it with "python2 /path/to/notifyfrndc.py". How to stop it? At the moment "ps xa | grep notifyfrndc" and then "kill pid" with the pid the ps resulted in.