Git Product home page Git Product logo

pubsubsuperfeedr's Introduction

pubsubsuperfeedr

A simple library designed to make it easy to add and remove feeds from Superfeedr's PubSubHubbub API. Includes support for hub.secret.

Credits

Developed and used at Urban Airship and released under the MIT License.

Harper Reed's gae-superfeedr-shell provided inspiration for part of this code. Thanks Harper!

Example Usage

Setting up pubsubsuperfeedr:

>>> import pubsubsuperfeedr >>> sf = pubsubsuperfeedr.Superfeedr(settings.SUPERFEEDR_USERNAME, settings.SUPERFEEDR_PASSWORD)

Validating a feed to make sure that it has at least one readable entry:

>>> sf.verify_feed_url("http://blog.urbanairship.com/feed/") True

Note that this is just a really simple wrapper around feedparser and sometimes feedparser can read things that Superfeedr can't.

Adding a feed:

>>> sf.add_feed("http://blog.urbanairship.com/feed/", "http://example.com/your_callback_url", "some_verify_token", "some_secret")

add_feed expects the feed you're wanting to watch, then the callback URL, and optionally a verify token and feed secret.

Removing a feed:

>>> sf.remove_feed("http://blog.urbanairship.com/feed/", "http://example.com/your_callback_url", "some_secret")

Removing a feed is basically the same as adding a feed.

Verifying a secret (in Django):

>>> sf.verify_secret("some_secret", request.raw_post_data, request.META.get("HTTP_X_HUB_SIGNATURE", "")) True

Testing

To run the tests, first make sure that nose and mox are installed. Then:

$ nosetests

And you're off an running.

pubsubsuperfeedr's People

Contributors

coddingtonbear avatar fardog avatar mtrichardson avatar robotadam avatar

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.