Screen Scraping in Ruby + Read/Write to MySQL server
$30-250 USD
Completed
Posted almost 11 years ago
$30-250 USD
Paid on delivery
I have a MySQL server on a remote linux box already. There may be installation requirements for ruby.
I need this written in Ruby, because I will have to use Watir to interpret a javascript-driven website.
This will have to be run from a cronjob (but I can handle that). The code I need is essentially:
# require nokogiri, open-uri, watir, mysql
# Mysql database exists already with schema + data.
#
# Get url data from database (url, min_price, max_price, undercut_by, admin_latest_price)
# For each URL
# Scrape up to Top 2 Seller names (new products only), total price
# If OURACCOUNT is the lowest price seller [check if we are within undercut_by of next seller]
# Check if OURACCOUNT_curr_total_price = undercut_by + seller_number_2_price
# Yes: Do nothing
# No: set admin_latest_price = (seller_number_2_price - undercut_by)
# Write admin_latest_price to DB
# else
# Check if total_price_seller lower than min_price
# No -> set admin_latest_price = (total_price_seller - undercut_by)
# Yes -> set admin_latest_price = admin_min_price
# Write admin_latest_price to DB
#