Skip to content

Instantly share code, notes, and snippets.

@tomykaira
Created March 17, 2012 14:50
Show Gist options
  • Save tomykaira/2060445 to your computer and use it in GitHub Desktop.
Save tomykaira/2060445 to your computer and use it in GitHub Desktop.
Usage of murmuring spider (https://github.com/tomykaira/murmuring_spider)
# -*- 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