• Stars
    star
    290
  • Rank 142,981 (Top 3 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ruby gem to inspect completely a web page. It scrapes a given URL, and returns you its meta, links, images more.

Webinspector

Ruby gem to inspect completely a web page. It scrapes a given URL, and returns you its title, description, meta, links, images and more.

See it in action!

You can try WebInspector live at this little demo: https://scrappet.herokuapp.com

Installation

Add this line to your application's Gemfile:

gem 'webinspector'

And then execute:

$ bundle

Or install it yourself as:

$ gem install webinspector

Usage

Initialize a WebInspector instance for an URL, like this:

page = WebInspector.new('http://davidesantangelo.com')

Accessing response status and headers

You can check the status and headers from the response like this:

page.response.status  # 200
page.response.headers # { "server"=>"apache", "content-type"=>"text/html; charset=utf-8", "cache-control"=>"must-revalidate, private, max-age=0", ... }

Accessing inpsected data

You can see the data like this:

page.url                 # URL of the page
page.scheme              # Scheme of the page (http, https)
page.host                # Hostname of the page (like, davidesantangelo.com, without the scheme)
page.port                # Port of the page
page.title               # title of the page from the head section, as string
page.description         # description of the page
page.links               # every link found
page.images              # every image found
page.meta                # metatags of the page

Accessing meta tags

page.meta                 # metatags of the page
page.meta['description']  # meta description
page.meta['keywords']     # meta keywords

Find words (as array)

page.find(["word1, word2"]) # return {"word1"=>3, "word2"=>1}

Contributors

License

The webinspector GEM is released under the MIT License.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/webinspector/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

develop

More Repositories

1

dato.rss

The best RSS Search experience you can find
Ruby
624
star
2

api.rss

RSS as RESTful. This service allows you to transform RSS feed into an awesome API.
Ruby
345
star
3

datoji

A tiny JSON storage service. Create, Read, Update, Delete and Search JSON data.
Ruby
225
star
4

searq.org

SearQ, the RSS search engine that is both speedy and free! SearQ offers a RESTful API that simplifies the search for data from RSS feeds. Finding what you need has never been easier with SearQ.
Ruby
94
star
5

api.rss.ui

Simple search interface around FeediRSS API.
JavaScript
51
star
6

tuns

Twitter Unfollower Notification Service. Keep track when someone unfollow you on Twitter.
Ruby
44
star
7

emailhunter

A tiny Ruby wrapper around Hunter (former EmailHunter) API (https://hunter.io/)
Ruby
41
star
8

restcountry

This is a Ruby wrapper library around the API provided by REST Countries http://restcountries.eu
Ruby
34
star
9

geoplugin

This is a Ruby wrapper library around the API provided by Geoplugin (http://www.geoplugin.com).
Ruby
9
star
10

secrypto

simple API for encrypt/decrypt text
Ruby
9
star
11

github-search-react

Simple fetching data from GitHub API with react and axios.
JavaScript
9
star
12

gameoflife

This is a Rails implementation of "Conway's Game of Life." Conway's game is a mathematical simulation where cells live or die based on certain rules.
Ruby
8
star
13

gemsbot

Telegram Bot wrapper for the RubyGems.org API
Ruby
7
star
14

github-vue-card

Vue.js + GitHub REST API + Tailwind CSS
Vue
6
star
15

scrappet-rest-api

rails app for web scraping purposes. It scrapes a given page (by the URL), and returns you all informations about that page.
Ruby
6
star
16

curl-gems

A basic cURL wrapper around RubyGems.org API
Ruby
4
star
17

text_search

TextSearch allows to count the number of occurrences of a word in a text.
Ruby
3
star
18

hnow

A new and alternative interface to Hacker News
Ruby
3
star
19

geopweb

Just a little demo of the geoplugin ruby gem
Ruby
3
star
20

apiwha

A tiny ruby wrapper around apiwha whatsapp API (https://apiwha.com)
Ruby
2
star
21

bibliotech

RESTful library management API
Ruby
1
star