https://github.com/mre/daylite-touch-sync-notification
Monitor Daylite Touch syncs on your Mac. Show a notification after each sync.
https://github.com/mre/daylite-touch-sync-notification
cloud daylite daylite-server logfile notification pusher python
Last synced: over 1 year ago
JSON representation
Monitor Daylite Touch syncs on your Mac. Show a notification after each sync.
- Host: GitHub
- URL: https://github.com/mre/daylite-touch-sync-notification
- Owner: mre
- License: gpl-3.0
- Created: 2014-02-12T00:15:06.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-02-09T10:11:46.000Z (over 11 years ago)
- Last Synced: 2025-02-06T12:48:20.098Z (over 1 year ago)
- Topics: cloud, daylite, daylite-server, logfile, notification, pusher, python
- Language: Python
- Size: 285 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Daylite Touch Notify
====================

What is it?
-----------
Monitor Daylite Touch syncs on your Mac.
This is useful for admins, who want to be sure that the Daylite Server is working correctly.
The tool consists of two parts, a server and a client script.
### Server
This part runs on the machine with your Daylite Server installed.
The software uses [watchdog](https://pypi.python.org/pypi/watchdog) to detect changes in the Daylite Touch logfile.
Whenever a user syncs with Daylite, this file gets modified and a message is broadcasted to all clients (using [pusher](http://www.pusher.com)).
### Client
On the client machine, another script receives the pusher message and displays an OSX notification popup for each synchronization.
You can write new clients with ease. Any platform and language is supported. Just subscribe to the pusher channel and you will receive updates automatically. I'll happily accept pull requests.
Howto
-----
1. Register at [pusher.com](http://www.pusher.com)
2. Insert your pusher key into `dtouchclient.py`.
3. Insert your pusher app-id, key and secret into `dtouchserver.py`.
4. Start `dtouchserver.py` on your server.
5. Start `dtouchclient.py` on your client.
Running the script in the background
------------------------------------
If you want to have the script running as a daemon process, which starts automatically, you can use `launchctl` and a plist file on Mac OS X. Here is how.
### On the server
./setup_server.sh
### On the client
./setup_client.sh
This will place the scripts in `/usr/bin` and immediately run the program.
If you ever want to remove the script, you can use the unload command of `launchctl`, e.g.:
launchctl unload ~/Library/LaunchAgents/de.matthias-endler.dtouchclient.plist
(Instructions adapted from [mnem on StackOverflow](http://stackoverflow.com/a/9523030/270334))
Troubleshooting
---------------
If you can't get it to work, look into the `dtouchserver` logfile first.
tail ~/Library/Logs/dtouchserver.log
You should see messages like `20XX-XX-XX XX:XX:XX,XXX Sync from user (OUT:9/IN:9)`.
If not, something's wrong with the server. Try to run the script directly with
`python dtouchserver.py`.
If everything looks fine until here, check your credentials (API key,...) again.
After that, run the client locally with `python dtouchclient.py`. If you can get
messages but nothing happens when you run the setup script, you can add a logger
to your plist file (follow the instructions in `de.matthias-endler.dtouchclient.plist`)
If the logfile tells you about import errors, replace
#!/usr/bin/env python
inside `dtouchclient.py` with the output of `which python` and run
`./setup_client` again.