Project

pingback

0.01
No commit activity in last 3 years
No release in over 3 years
This library enables the user to write pingback aware applications.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.0
= 0.1.1
= 0.8.7
>= 2.5.0
>= 1.6.2

Runtime

>= 0
 Project Readme

Pingback¶ ↑

This library enables the user to write pingback aware applications. It consists of two components, the client and the server. The specs of pingback are available at hixie.ch/specs/pingback/pingback-1.0

Client¶ ↑

The client provides the methods for sending pingback requests.

Server¶ ↑

The server is a simple Rack application, which should be used to receive pingback requests. Notice that this class does not know how to handle a pingback request, this is application specific. Therefore a proc in which the request is handled has to be provided. This design was chosen to enable the users of this library a maximum of flexibility. The pingback specification suggest some steps on how to process a request. Personally I dont think that its a good idea to allow some strangers to request some URIs from my server.

Installation¶ ↑

gem install pingback

Usage¶ ↑

sending pingback requests¶ ↑

source_uri = "http://myblog.com/articles/2"
target_uri = "http://someblog.com/articles/16"

Pingback::Client.new.ping(source_uri, target_uri)

receiving pingback requests¶ ↑

Notice that this class does not know how to handle a pingback request, it simply provides the general set-up. Therefore a proc in which the request is handled has to be provided.

Pingback::Server.new(Proc.new { |source_uri, target_uri|
  raise GenericFaultException unless Linkback.create(source_uri, target_uri)
})

marking a resource as pingback-enabled¶ ↑

To mark a resource as pingback-enabled the header must contain the URI of the pingback-server in the field “X-Pingback”.