Project

scraptory

0.0
No commit activity in last 3 years
No release in over 3 years
A simple scraping gem using tor
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0.1.2
>= 1.0.1
>= 0.1.4
 Project Readme

Scraptory

Scraptory is a ruby scraper that can use tor as proxy.

Install

gem install scraptory

Or you can install from this repository :

git clone https://github.com/AlexMili/scraptory
cd scraptory
gem build scraptory.gemspec
gem install scraptory-0.1.0.gem

Usage

# encoding: UTF-8

require 'scraptory'

scraper = Scraptory.new({"debug"=>true,"debug_file"=>"test.log","retry_on_error"=>true})

myProxy = Proxy.new(
	"localhost", #Host
	9050, #Port
	{:tor=>true,:timeout=>10,:type=>"socks4"}, #Options
	{:telnet_host=>"localhost",:telnet_port=>9051,:telnet_passwd=>"myPasswd"})#Credentials

scraper.add_proxy(myProxy)

scraper.queue("http://google.com", lambda{|response|
	print("Google success")
})

scraper.queue("http://github.com", lambda{|response|
	print("Github success")
})

scraper.queues(["http://google.com","http://github.com"], lambda{|response|
	print("Websites success")
})

scraper.scrap()