Rewriting some tools as scrapy spiders #30
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For what it's worth, here's an attempt to rewrite some of Ahmia's test tools as Scrapy spiders (#20). The original test tools are unchanged.
Needs review and additional testing to ensure any differences between my own environment and Ahmia production environment don't cause problems, and generally to assess whether these changes are worthwhile. A list of rewritten tools plus use / notes for each is below (commands are executed from ahmia/tools directory).
Collects links to onions and then PUTs the list of links to Ahmia endpoint. To run:
$ scrapy crawl finder_spider
Iterates a list of tor2web nodes and saves their visited domains lists to disk. To run:
$ scrapy crawl t2w_domain_spider
Downloads the list of hashes of blacklisted onions from a set of tor2web nodes and saves the blacklist to disk.
$ scrapy crawl t2w_filter_spider
A backlink counting utility; accepts 4 arguments: target, host, links, count (boolean).
The only required argument is target, which instructs the crawler what URL to search backlinks for. Args are passed in the format expected by scrapy, for example:
$ scrapy crawl backlinkspider -a target="http://www.nytimes.com/" -a count=true
Tests whether hidden services are online.
$ scrapy crawl test_services_spider