Created
March 17, 2012 14:50
-
-
Save tomykaira/2060445 to your computer and use it in GitHub Desktop.
Usage of murmuring spider (https://github.com/tomykaira/murmuring_spider)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Usage: bundle exec clockwork this_script.rb | |
# Gemfile is something like this: | |
# | |
# source :rubygems | |
# | |
# gem 'clockwork' | |
# gem 'murmuring_spider', git: 'git://github.com/tomykaira/murmuring_spider.git' | |
# | |
# gem 'dm-sqlite-adapter' | |
# | |
require 'rubygems' | |
require 'clockwork' | |
require 'murmuring_spider' | |
include Clockwork | |
include MurmuringSpider | |
database_init(ENV['DATABASE_URL']) | |
if Operation.count == 0 | |
Operation.add(:search, 'Ruby', :rpp => 100) | |
end | |
every(1.minute, 'search') do | |
Operation.run_all | |
puts Status.count | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment