<commit_before># Pingr - Tell search engines about your sitemap changes

Pingr is a super-simple gem built for the [blogit](http://github.com/KatanaCode/blogit "A Rails Blogging Engine") project.

## Installation

Add this line to your application's Gemfile:

    gem 'pingr'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install pingr

## Usage

From within your app (most likely a controller):

``` ruby
def ping_sitemaps
  Pingr::Request.new(:google, my_sitemap_url).ping
end
```

A good way to do this would be using Rails's after filters:

``` ruby
class PostsController < ActionController::Base

  after_filter :ping_sitemaps, only: [:create, :update, :destroy]
  
  # ... 
  
  private
  
  def ping_sitemaps
    Pingr::Request.new(:google, my_sitemap_url).ping
  end
  
end
```

You can ping all supported search engines by doing:

``` ruby
def ping_sitemaps
  for search_engine in Pingr::SUPPORTED_SEARCH_ENGINES
    Pingr::Request.new(search_engine, my_sitemap_url).ping
  end<commit_msg>Added path to README for supported search engines<commit_after># Pingr - Tell search engines about your sitemap changes

Pingr is a super-simple gem built for the [blogit](http://github.com/KatanaCode/blogit "A Rails Blogging Engine") project.

## Installation

Add this line to your application's Gemfile:

    gem 'pingr'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install pingr

## Usage

From within your app (most likely a controller):

``` ruby
def ping_sitemaps
  Pingr::Request.new(:google, my_sitemap_url).ping
end
```

A good way to do this would be using Rails's after filters:

``` ruby
class PostsController < ActionController::Base

  after_filter :ping_sitemaps, only: [:create, :update, :destroy]
  
  # ... 
  
  private
  
  def ping_sitemaps
    Pingr::Request.new(:google, my_sitemap_url).ping
    Pingr::Request.new(:bing, my_sitemap_url).ping
  end
  
end
```

You can ping all [supported search engines](/lib/pingr.rb) by doing:

``` ruby
def ping_sitemaps
  for search_engine in Pingr::SUPPORTED_SEARCH_ENGINES
    Pingr::Request.new(search_engine, my_sitemap_url).ping
  end
{'fraction_non_alphanumeric': 0.09433085501858736, 'fraction_numerical': 0.0, 'mean_word_length': 4.08983451536643, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3034281', 'n_tokens_mistral': 760, 'n_tokens_neox': 709, 'n_words': 224}