Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding description

  • Loading branch information...
commit 51f0a0562204f6d9f244a5b2c4095e2594c2a8db 1 parent 5881466
Maksym Naboka authored
Showing with 44 additions and 1 deletion.
  1. +1 −1  AutoRiaUa.pl
  2. +43 −0 README
2  AutoRiaUa.pl
View
@@ -196,7 +196,7 @@ sub parse {
##########################################################################
## INSERTING INTO DB ##
##########################################################################
-
+ exit;
eval { $DBi->insert($self->{db}->{table}, {
autoId => $autoid,
model => $model,
43 README
View
@@ -2,5 +2,48 @@ 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
Please sign in to comment.
Something went wrong with that request. Please try again.