<commit_before># Torckapi — torrent tracker querying API

[![Gem Version](https://badge.fury.io/rb/torckapi.svg)](https://rubygems.org/gems/torckapi)
[![Dependency Status](https://gemnasium.com/krupenik/torckapi.svg)](https://gemnasium.com/krupenik/torckapi)
[![Code Climate](https://codeclimate.com/github/krupenik/torckapi.png)](https://codeclimate.com/github/krupenik/torckapi)

## Description

Torckapi is a querying interface to torrent trackers.

## Synopsis

```
tracker = Torckapi.tracker("udp://generic.url:80/announce")
# => #<Torckapi::Tracker::UDP:0x007fb5941f6ef8
#      @url=#<URI::Generic:0x007fb5941f7038 URL:udp://generic.url:80/announce>,
#      @options={:timeout=>15, :tries=>3}>
```

### Queries
```
tracker.announce("0123456789ABCDEF0123456789ABCDEF01234567")
# => #<Torckapi::Response::Announce:0x007fa1bc0f11c0
#      @info_hash="0123456789ABCDEF0123456789ABCDEF01234567",
#      @leechers=1,
#      @seeders=1,
#      @peers=[["127.0.0.1", 54078], ["127.0.0.2", 43666]]>

tracker.scrape(["0123456789ABCDEF0123456789ABCDEF01234567", "123456789ABCDEF0123456789ABCDEF012345678"])
# => #<Torckapi::Response::Scrape:0x007fa1bc0fe320<commit_msg>switched badge service to shields.io<commit_after># Torckapi — torrent tracker querying API

[![Gem Version](https://img.shields.io/gem/v/torckapi.svg)](https://rubygems.org/gems/torckapi)
[![Dependencies Status](https://img.shields.io/gemnasium/krupenik/torckapi.svg)](https://gemnasium.com/krupenik/torckapi)
[![Code Climate](https://img.shields.io/codeclimate/github/krupenik/torckapi.svg)](https://codeclimate.com/github/krupenik/torckapi)

## Description

Torckapi is a querying interface to torrent trackers.

## Synopsis

```
tracker = Torckapi.tracker("udp://generic.url:80/announce")
# => #<Torckapi::Tracker::UDP:0x007fb5941f6ef8
#      @url=#<URI::Generic:0x007fb5941f7038 URL:udp://generic.url:80/announce>,
#      @options={:timeout=>15, :tries=>3}>
```

### Queries
```
tracker.announce("0123456789ABCDEF0123456789ABCDEF01234567")
# => #<Torckapi::Response::Announce:0x007fa1bc0f11c0
#      @info_hash="0123456789ABCDEF0123456789ABCDEF01234567",
#      @leechers=1,
#      @seeders=1,
#      @peers=[["127.0.0.1", 54078], ["127.0.0.2", 43666]]>

tracker.scrape(["0123456789ABCDEF0123456789ABCDEF01234567", "123456789ABCDEF0123456789ABCDEF012345678"])
# => #<Torckapi::Response::Scrape:0x007fa1bc0fe320
{'fraction_non_alphanumeric': 0.18327028163093737, 'fraction_numerical': 0.15384615384615385, 'mean_word_length': 6.555555555555555, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2691375', 'n_tokens_mistral': 1205, 'n_tokens_neox': 938, 'n_words': 89}