Giter Club home page Giter Club logo

pingback's Introduction

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”.

pingback's People

Contributors

andreaswurm avatar bradphelan avatar stefansundin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pingback's Issues

Issues with syntax & documentation for client

First, your documentation is wrong for sending client pingbacks.

You have:

source_uri = "http://myblog.com/articles/2"
target_uri = "http://someblog.com/articles/16"
Pingback::Client.send(source_uri, target_uri)

It should be:

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

...as you have defined the "send" method as an instance method, not a class level one.

Second, choosing the name "send" for a library in ruby is a bad, bad idea. "Send" is a reserved keyword. You should change it to something like "ping" or "send_pingback"

For documentation on the send method, see: http://www.ruby-doc.org/core/classes/Object.html#M000999

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.