Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby web-scraping script for Doppler Value Investing
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
categories
data/dopeler/input
db
lib
spec
.DS_Store
.gitignore
Gemfile
Gemfile.lock
README
Rakefile
dvi_scrape.gemspec

README

RUBY COMMANDS FOR LOADING dvi_scrape:
require 'rubygems'
require 'dvi_scrape'

DEVELOPMENT ENVIRONMENT PRERQUISITES:

1.  Create the PostgreSQL database and make yourself a superuser.  The commands for 
doing this are as follows:
sudo su postgres -c psql
CREATE ROLE [local username] SUPERUSER LOGIN;
\q
createdb <name of database>

2.  Provide the name of the PostgreSQL database to the gem.  This information is 
stored in the config/db_name.txt file.  The following command carries out the task:
Dvi_scrape.SetDbName([name of database])

3.  To verify the database name that the gem expects to work, enter the following command:
puts Dvi_scrape.GetDbName

4.  To verify the database username, enter the following command:
puts Dvi_scrape.GetDbUsername

5.  To verify the database password, enter the following command:
puts Dvi_scrape.GetDbPassword

PRODUCTION ENVIRONMENT PREREQUISITES:

1.  You MUST create the PostgreSQL database.

2.  Provide the name of the PostgreSQL database to the gem.  This information is 
stored in the config/db_name.txt file.  The following command carries out the task:
Dvi_scrape.SetDbName([name of database])

3.  To verify the database name that the gem expects to work, enter the following command:
puts Dvi_scrape.GetDbName

4.  Create the directory /home/[system username]/.db_params/.[database name] .
Please note the periods before "db_params" and the database name.

5.  In the above directory, create a file called .username and put the 
database username in it.  In this same directory, create a file called .password 
and put the database password in it.

6.  To verify the database username, enter the following command:
puts Dvi_scrape.GetDbUsername

7.  To verify the database password, enter the following command:
puts Dvi_scrape.GetDbPassword

After you install the gem, load it by entering irb or Rails console and then
entering the command "require 'dvi_scrape'"

Run the short version of the script:
Dvi_scrape.analyze

Run the long version of the script with a random delay of up to 0.1 minutes:
Dvi_scrape.analyze (:long => true, :delay_max => 0.1)

Clear the archives of financial statements for each stock:
Dvi_scrape.clear

Print the contents of the database as a CSV file to a path name:
Dvi_scrape.DbToCsv(<path name>)
Something went wrong with that request. Please try again.