{"id":15512150,"url":"https://github.com/bkeepers/spiderman","last_synced_at":"2025-10-14T16:06:10.657Z","repository":{"id":48733060,"uuid":"249171086","full_name":"bkeepers/spiderman","owner":"bkeepers","description":"your friendly neighborhood web crawler","archived":false,"fork":false,"pushed_at":"2022-07-26T13:15:48.000Z","size":40,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-05T23:08:27.609Z","etag":null,"topics":["crawler","crawler-engine","http","httprb","nokogiri","ruby","spider","spider-framework","web-crawler","web-scraping","webcrawler","webscraping"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bkeepers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-22T11:42:18.000Z","updated_at":"2024-05-01T05:41:16.000Z","dependencies_parsed_at":"2022-08-27T07:51:34.115Z","dependency_job_id":null,"html_url":"https://github.com/bkeepers/spiderman","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fspiderman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fspiderman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fspiderman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fspiderman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkeepers","download_url":"https://codeload.github.com/bkeepers/spiderman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590614,"owners_count":21772938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crawler","crawler-engine","http","httprb","nokogiri","ruby","spider","spider-framework","web-crawler","web-scraping","webcrawler","webscraping"],"created_at":"2024-10-02T09:53:28.968Z","updated_at":"2025-10-14T16:06:05.619Z","avatar_url":"https://github.com/bkeepers.png","language":"Ruby","readme":"\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e\u003cimg width=\"300\" height=\"300\" src=\"https://user-images.githubusercontent.com/173/77249168-99488080-6c15-11ea-98de-3d14a412265d.png\" alt=\"Spiderman\"\u003e\u003c/h1\u003e\n\n  \u003ch2\u003eyour friendly neighborhood web crawler\u003c/h2\u003e\n\u003c/div\u003e\n\nSpiderman is a Ruby gem for crawling and processing web pages.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'spiderman'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install spiderman\n\n## Usage\n\n```ruby\nclass HackerNewsCrawler\n include Spiderman\n\n crawl \"https://news.ycombinator.com/\" do |response|\n   response.css('a.storylink').each do |a|\n     process! a[\"href\"], :story\n   end\n end\n\n process :story do |response|\n   logging.info \"#{response.uri} #{response.css('title').text}\"\n   save_page(response)\n end\n\n def save_page(page)\n   # logic here for saving the page\n end\nend\n```\n\nRun the crawler:\n\n```ruby\nHackerNewsCrawler.crawl!\n```\n\n### ActiveJob\n\nSpiderman works with [ActiveJob](https://edgeguides.rubyonrails.org/active_job_basics.html) out of the box. If your crawler class inherits from `ActiveJob:Base`, then requests will be made in your background worker. Each request will run as a separate job.\n\n```ruby\nclass MyCrawer \u003c ActiveJob::Base\n  queue_as :crawler\n\n  crawl \"https://example.com\" do |response|\n    response.css('a').each {|a| process! a[\"href\"], :link }\n  end\n\n  process :link do |response|\n    logger.info \"Processing #{response.uri}\"\n  end\nend\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/bkeepers/spiderman.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkeepers%2Fspiderman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkeepers%2Fspiderman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkeepers%2Fspiderman/lists"}