{"id":13747443,"url":"https://github.com/davidesantangelo/webinspector","last_synced_at":"2025-04-04T19:14:19.102Z","repository":{"id":31060828,"uuid":"34619624","full_name":"davidesantangelo/webinspector","owner":"davidesantangelo","description":"Ruby gem to inspect completely a web page. It scrapes a given URL, and returns you its meta, links, images more.","archived":false,"fork":false,"pushed_at":"2017-04-07T14:34:19.000Z","size":32,"stargazers_count":290,"open_issues_count":0,"forks_count":26,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-05-01T20:55:39.960Z","etag":null,"topics":["inspector","ruby","rubygem","scraper","web-inspector"],"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/davidesantangelo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-26T16:14:59.000Z","updated_at":"2024-01-26T22:01:52.000Z","dependencies_parsed_at":"2022-08-17T18:05:30.280Z","dependency_job_id":null,"html_url":"https://github.com/davidesantangelo/webinspector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fwebinspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fwebinspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fwebinspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidesantangelo%2Fwebinspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidesantangelo","download_url":"https://codeload.github.com/davidesantangelo/webinspector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234923,"owners_count":20905854,"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":["inspector","ruby","rubygem","scraper","web-inspector"],"created_at":"2024-08-03T06:01:29.203Z","updated_at":"2025-04-04T19:14:19.084Z","avatar_url":"https://github.com/davidesantangelo.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# WebInspector\n\nRuby gem to inspect web pages. It scrapes a given URL and returns its title, description, meta tags, links, images, and more.\n\n\u003ca href=\"https://codeclimate.com/github/davidesantangelo/webinspector\"\u003e\u003cimg src=\"https://codeclimate.com/github/davidesantangelo/webinspector/badges/gpa.svg\" /\u003e\u003c/a\u003e\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'webinspector'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install webinspector\n\n## Usage\n\n### Initialize a WebInspector instance\n\n```ruby\npage = WebInspector.new('http://example.com')\n```\n\n### With options\n\n```ruby\npage = WebInspector.new('http://example.com', {\n  timeout: 30,                         # Request timeout in seconds (default: 30)\n  retries: 3,                          # Number of retries (default: 3) \n  headers: {'User-Agent': 'Custom UA'} # Custom HTTP headers\n})\n```\n\n### Accessing response status and headers\n\n```ruby\npage.response.status  # 200\npage.response.headers # { \"server\"=\u003e\"apache\", \"content-type\"=\u003e\"text/html; charset=utf-8\", ... }\npage.status_code      # 200\npage.success?         # true if the page was loaded successfully\npage.error_message    # returns the error message if any\n```\n\n### Accessing page data\n\n```ruby\npage.url           # URL of the page\npage.scheme        # Scheme of the page (http, https)\npage.host          # Hostname of the page (like, example.com, without the scheme)\npage.port          # Port of the page\npage.title         # title of the page from the head section\npage.description   # description of the page\npage.links         # array of all links found on the page (absolute URLs)\npage.images        # array of all images found on the page (absolute URLs)\npage.meta          # meta tags of the page\npage.favicon       # favicon URL if available\n```\n\n### Working with meta tags\n\n```ruby\npage.meta                 # all meta tags\npage.meta['description']  # meta description\npage.meta['keywords']     # meta keywords\npage.meta['og:title']     # OpenGraph title\n```\n\n### Filtering links and images by domain\n\n```ruby\npage.domain_links('example.com')  # returns only links pointing to example.com\npage.domain_images('example.com') # returns only images hosted on example.com\n```\n\n### Searching for words\n\n```ruby\npage.find([\"ruby\", \"rails\"]) # returns [{\"ruby\"=\u003e3}, {\"rails\"=\u003e1}]\n```\n\n### Export all data to JSON\n\n```ruby\npage.to_hash # returns a hash with all page data\n```\n\n## Contributors\n\n  * Steven Shelby ([@stevenshelby](https://github.com/stevenshelby))\n  * Sam Nissen ([@samnissen](https://github.com/samnissen))\n\n## License\n\nThe WebInspector gem is released under the MIT License.\n\n## Contributing\n\n1. Fork it ( https://github.com/davidesantangelo/webinspector/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidesantangelo%2Fwebinspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidesantangelo%2Fwebinspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidesantangelo%2Fwebinspector/lists"}