Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

script which grabs autos from http://auto.ria.ua/ and stores in local database

tree: efe76e5610

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 AutoRiaUa.pl performance improve January 19, 2012
Octocat-spinner-32 AutoRiaUa_more_info_but_super_slow.pl oops2 January 24, 2012
Octocat-spinner-32 README
README
Hello guys

Here is parser which takes cars from http://auto.ria.ua and stores in database. Pretty simple but it works

it uses:
DBIx::Simple
SQL::Abstract
Mojo::UserAgent
Mojo::DOM

How to use it:
under package main create an AutoRiaUa object
#####################################################################################################################
package main;
my $obj = AutoRiaUa->new(
		debug => 1,   			#To turn on debugging info on STDOUT 
		
		db => { 
		 engine => 'mysql',		#Can be mysql,sqlite for more drivers see http://search.cpan.org/~timb/DBI-1.616/DBI.pm

		 user => 'root',		#Username for DB
                 password => '',		#Pass for DB
                 database => 'auto',		#DB name, for sqlite must be location to a file
                 table => 'cars'		#Table to store info
		},

		cond => {			#Condition of cars
                 year_from => '2007',		#Year from
                 year_to => '2011',		#Year to
                 gear => '-1',			#Gear: [-1 = automatic; 1 = manual]
                 price_from => '8000',		#Proce from
                 price_to => '12000'		#Proce to
        	},				#Options will be added...

);
#####################################################################################################################

AutoRiaUa object has got only one method 'parse'

$obj->parse

This will parse and store auto into DB. No need to create table in database. Script will create table schema if it's not present.





maksym.naboka@gmail.com

Something went wrong with that request. Please try again.