Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleander/ucallback
The missing link between µTorrent and the console in OS X
https://github.com/oleander/ucallback
Last synced: about 2 months ago
JSON representation
The missing link between µTorrent and the console in OS X
- Host: GitHub
- URL: https://github.com/oleander/ucallback
- Owner: oleander
- Created: 2011-02-09T04:34:16.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-02-09T04:36:10.000Z (almost 14 years ago)
- Last Synced: 2023-04-10T09:40:13.613Z (almost 2 years ago)
- Language: Ruby
- Homepage: https://github.com/oleander/uCallback
- Size: 97.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# µCallback
## What is µCallback?
µCallback makes it possible to call a script or application when a BitTorrent download finishes.
It has support both [Transmission](http://www.transmissionbt.com/) and [µTorrent](http://user.utorrent.com/), even though Transmission already supports it.
## How to use
### Installation
[sudo] gem install ucallback
### An example - The *synchronous* versionThis example listen for µTorrent downloads. When a download finishes, the block is being called with the name of the downloaded item.
So if you downloaded *House.S07E11.HDTV.XviD-LOL.avi* the `item` variable would be set to just that value.
#!/usr/bin/env rubyrequire 'rubygems'
require 'ucallback'Ucallback.listen('uTorrent') do |item|
# Do something with the information
end### A background example - The *asynchronous* version
The previous example runs as an synchronous script, but what if you what to run it in the background?
The [daemonize](http://daemons.rubyforge.org/) gem fixes this for us. It daemonizes the current thread so we can run it in the background.
Don't forget to install `daemonize` using `[sudo] gem install daemons`
#!/usr/bin/env rubyrequire 'rubygems'
require 'ucallback'
require 'daemons'
Daemons.daemonize
Ucallback.listen('Transmission') do |item|
# Do something with the information
endSave the code above to a file, run `chmod +x the_file_you_just_created` on it and you should be able to start it using `the_file_you_just_created`.
## How to help
- Start by copying the project or make your own branch.
- Navigate to the root path of the project and run `bundle`.
- Start by running all tests using rspec, `rspec spec/ucallback_spec.rb`.
- Implement your own code, write some tests, commit and do a pull request.## Requirements
µCallback is tested on OS X 10.6.6 using Ruby 1.8.7.
With µTorrent [beta 1.1](http://user.utorrent.com/downloads/mac).**µCallback only works with µTorrent versions that supports [Growl](http://growl.info/) messages.**