Skip to content

Instantly share code, notes, and snippets.

View jaigouk's full-sized avatar

Jaigouk Kim jaigouk

View GitHub Profile
require 'rubygems'
require 'scrubyt'
# I installed firewatir on my firefox 3.0
# And running "ruby merb_readme.rb" lauches firefox and then go to the right page.
property_data = Scrubyt::Extractor.define :agent => :firefox do
fetch 'http://merbivore.com/documentation/current/doc/rdoc/stack/'
# There's also another 'files' link in the page.
# So I had to write exact location of the link.
require 'rubygems'
require 'scrubyt'
# I installed firewatir on my firefox 3.0
# And running "ruby scrubyt_ajax.rb" lauches firefox and then go to the right page.
property_data = Scrubyt::Extractor.define :agent => :firefox do
fetch 'http://merbivore.com/documentation/current/doc/rdoc/stack/'
# There's also another 'files' link in the page.
# So I had to write exact location of the link.
# This script runs ok with firewatir.
require 'rubygems'
require 'scrubyt'
Scrubyt.logger = Scrubyt::Logger.new
property_data = Scrubyt::Extractor.define :agent => :firefox do
fetch 'http://merbivore.com/documentation/current/doc/rdoc/stack/index.html?a=F00000098&name=README'
doc "//div[@id='rdocContent']"
require 'rubygems'
gem('twitter4r', '0.3.0')
require 'twitter'
require 'twitter_search'
require 'time'
require 'nokogiri'
require 'open-uri'
array = @wycat_merb_commits = []
@long_messages = []
require 'rubygems'
gem('twitter4r', '0.3.0')
require 'twitter'
require 'twitter_search'
require 'time'
require 'nokogiri'
require 'open-uri'
array = @wycat_merb_commits = []
@long_messages = []
Merb::Config[:framework] = {
:application => Merb.root / "application.rb",
:config => [Merb.root / "config", nil],
:public => [Merb.root / "public", nil],
:model => Merb.root / "models",
:view => Merb.root / "views"
}
# referenced API.
# http://merbapi.com/classes/Merb/BootLoader/BuildFramework.html
class Tweet
include DataMapper::Resource
property :id, Serial
property :message, Text, :length => 255, :nullable => false, :unique => true
property :name, String, :length => 20, :nullable => false
property :category, String, :length => 20
property :link, String
use_orm :datamapper
use_test :rspec
use_template_engine :erb
merb_gems_version = "1.0.7.1"
dm_gems_version = "0.9.8"
dependency "merb-action-args", merb_gems_version
dependency "merb-assets", merb_gems_version
dependency "merb-helpers", merb_gems_version
dependency "merb-cache", merb_gems_version
...
#shows twitter
def index
render
end
...
def self.scrape
merb = 'http://github.com/wycats/merb/commits/1.0.x'
negotiation = 'http://github.com/wycats/rails/commits/master'
blog= 'http://yehudakatz.com'
self.get_commits_and_bark(merb, "edgemerb")
self.get_commits_and_bark(negotiation, "wycats_rails")
self.get_blog_and_bark(blog)
end