Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
Turtl is an HTTP proxy whose purpose is to throttle connections to
specific hostnames to avoid breaking terms of usage of those API
providers (like del.icio.us, technorati and so on).

The proxy can be used either as a library embedded in another
application or it can be started stand-alone using the provided twistd
plugin.

Here's an example to use turtl from inside another python application:

{{{
from twisted.internet import reactor
from turtl import proxy, config

s = """\
# defaults is pulled out of the end results
# and used to fill hostnames with missing
# parameters
defaults: &defaults
    # calls that can be made inside the interval of time
    calls: 1

    # interval is specified in seconds
    interval: 1

    # the number of concurrent calls that we are allowed to
    # have running at any given time.
    concurrency: 10

delicious.com:
    <<: [*defaults]

www.google.com:
    calls: 5
    interval: 1

filter-rest: True
port: 8080
"""

urlmap, rest, port = config.loadConfigFromString(s)
f = proxy.TurtlHTTPFactory(urlmap, rest)
reactor.listenTCP(port, f)
reactor.run()
}}}

And here's an example of a command line to start it stand alone:

{{{
twistd --logfile=/var/log/turtl.log --pidfile=/var/run/turtl.pid turtl -c /some/path/config.yaml -p turtlOne
}}}

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.