Reading torrent files might be useful for some people. Since FileBot already includes the code for that I'll quickly paste a Groovy snippet here on how to do it.
Sometimes it might be useful to override series auto-detection by forcing a series title for a specific set of files. This is how you do it. Only process a certain set of files via file parameter and force the series title via the query parameter.
rename(file: args.getFiles{ it =~ /(?i:colbert.report)/}, query: "The Colbert Report", db: "TheTVDB")
rename(file: args.getFiles{ it =~ /(?i:daily.show)/}, query: "The Daily Show with Jon Stewart", db: "TheTVDB")
...
Sometimes you might wanna grab data from websites, aka page scraping. Groovy with JSoup will greatly simplify any kind of scraping you wanna do. Here's an example of how to write a script that'll extract all links from a given page.
Here's a an example of how to use Groovy XML-RPC to hook into rtorrent and retrieve the list of completed downloads. If you got rutorrent running fine you can just use it's rpc proxy. Otherwise you might wanna look into the RTorrentXMLRPCGuide.
def f = 'X:/Cloud Atlas.mp4' as File
// fast file-name lookup
println matchMovie(f.name, false)
// full file-structure search/lookup
println detectMovie(f, false)
// fetch complete movie data
println TheMovieDB.getMovieInfo(detectMovie(f, false), Locale.ENGLISH)
Here's a little script to make sure the <id/> tag in .nfo files is well formatted according to IMDb/XBMC standards. This script will replace occurrences of something like <id>123456</id> and change it to <id>tt0123456</id> so FileBot and similar tools can easily recognize the IMDbID pattern.
Here's an example of how to plug in your rename function and copy files to a remote server via SSH/SFTP without creating any temporary files. Because scp won't create folders for us we have to call mkdir on the server first.