{"id":18558000,"url":"https://github.com/zh/webglue","last_synced_at":"2025-04-10T01:32:33.340Z","repository":{"id":612683,"uuid":"250668","full_name":"zh/webglue","owner":"zh","description":"PubSubHubbub Ruby implementation","archived":false,"fork":false,"pushed_at":"2012-04-02T17:09:59.000Z","size":159,"stargazers_count":85,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-24T14:38:01.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://webglue.onxen.net/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tstranex/carpcomm","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zh.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-14T06:39:35.000Z","updated_at":"2022-11-28T16:06:07.000Z","dependencies_parsed_at":"2022-07-05T03:30:52.931Z","dependency_job_id":null,"html_url":"https://github.com/zh/webglue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fwebglue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fwebglue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fwebglue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zh%2Fwebglue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zh","download_url":"https://codeload.github.com/zh/webglue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248140748,"owners_count":21054345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T21:38:38.933Z","updated_at":"2025-04-10T01:32:28.329Z","avatar_url":"https://github.com/zh.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"WebGlue\n========\n\n  PubSubHubbub Ruby implementation\n\n\nOverview\n---------\n\nPubSubHubbub (PSHB) is a simple, open, server-to-server web-hook-based pubsub \n(publish/subscribe) protocol as an extension to Atom. For more details see\nhttp://code.google.com/p/pubsubhubbub/ . \nCurrent project is as simple as possible implementation in Ruby of PSHB Core 0.2 \nDraft-compatible hub.\n\nImplemented features:\n\n - Publishing new topics (Atom Feeds)\n - Subscriptions to existing topics (including callbacks verification) - 'sync' and\n   'async' mode verifications\n - Fetching atom feeds, finding the new entries and sending them to all subscribers\n - Authenticated Content Distribution - 'hub.secret'\n \nStill missing (not implemented):\n\n - Publishers need to manually ping the hub (no automatic check for updated feeds)\n - Can only process Atom feeds, not RSS\n\n\nRequired gems\n--------------\n\n - sinatra - web framework - routing etc.\n - httpclient - POST requests, callbacks verification\n - crack - XML parsing\n - ratom - Atom feeds fetching/parsing\n - SystemTimer - for timeouts on unsuccessful requests\n - ruby-hmac - HMAC-SHA1 for content digests\n\nIf you are using http://heroku.com/ for deployment, your '.gems' file will look like:\n\n  httpclient\n  SystemTimer\n  crack\n  ratom\n  ruby-hmac\n\n\nRunning\n------\n\nThe whole system is implemented as a Sinatra [ http://www.sinatrarb.com/ ] application. \nTo start it locally (on port 4567 for example):\n\n  git clone git://github.com/zh/webglue.git   \n  cd webglue\n  bundle install\n  bundle exec rackup -p 4567 -s thin\n\nFor production environment, maybe using 'unicorn' is better:\n\n  bundle exec unicorn -c ./unicorn.conf -E production\n\n(optional)\n\n'async' verification worker process:\n\n- from crontab:\n\n  require 'worker'\n  WebGlue::Worker.verify\n\n- independent daemon (checks every WebGlue::Config.CHECK minutes)\n\n  require 'worker'\n  WebGlue::Worker.run\n\nOr you can uncomment the proper lines in worker.rb ('if __FILE__ == $0' block) and do\n\n  ruby worker.rb\n\nhttp://heroku.com/ will automatically recognize the startup file (config.ru) and will \nrun your application after the deployment:\n\n  git clone git://github.com/zh/webglue.git\n  cd webglue\n  heroku create mypubhub\n  git push heroku master\n\n\nPubSub\n-------\n\nBoth publishing and subscriptions going to the same endpoint - '/'. So if your application\nis running on URL http://localhost:4567/ , that will be the endpoint for both publishers\n(atom:link[@rel=\"hub\"] in the feed) and subscribers (POST requests for subscription).\nOnly for debugging purposes, there are two web form on '/publish' and '/subscribe' URLs.\n\n\nPublishing new topics\n----------------------\n\nIf your application is running on URL http://localhost:4567/ , go to \nhttp://localhost:4567/publish and insert your Atom feed in the 'Topic:' text box. Press\n\"Publish\". There will be no changes on the screen, because the hub is responding with\nHTTP code 204 \"No Content\".\n\nYou can also POST directly to http://localhost:4567/ with parameters, described\nin the \"PubSubHubbub Core 0.2\" document - \nhttp://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.2.html\n\nAlso in your feed, insert the line:\n\n  \u003clink rel=\"hub\" href=\"http://localhost:4567/\" /\u003e  (adjust for your install)\n\nFor now, there is no automatic check for updated feeds implemented, so after changes in\nsome feed, repeat the actions, described above (from the web form or via POST).\nPublishing is possible once every 5 min.\n\n\nSubscription to existing topics\n--------------------------------\n\nIf your application is running on URL http://localhost:4567/ , go to\nhttp://localhost:4567/subscribe and fill the web form:\n\n - Callback - URL to the webhook, which will receive Atom-formated notifications\n - Topic - Atom feed URL, ALREADY PUBLISHED to the system - see 'Publishing new topics' \n   above\n - Verify mode - Both 'Synchronous' and 'Asynchronous' modes supported\n - Mode - 'Subscribe' for adding new subscribers and 'Unsubscribe' for removing \n   the already inserted onces\n - Verify token - something that your callback need to approve\n - Secret - used to compute an HMAC digest of the content, send to the subscriber\n\nYou can send also POST subscription requests with the required parameters directly to\nthe hub endpoint (http://localhost:4567/ in our example).\n\nThe hub is implementing callbacks verification, described in the \"PubSubHubbub Core 0.2\" \ndocument (sending back 'hub.challenge' parameter in the response body).\nIn 'Synchronous' mode there will be no changes on the screen after subscription,  \nbecause the hub is responding with HTTP code 204 \"No Content\".\nIn 'Asynchronous' mode the hub will respond with HTTP code 202 \"Scheduled for verification\"\n\n\nNotifications format\n---------------------\n\nCurrent implementation fetch the Atom feeds and just remove already known entries from \nthem, without touching other parts of the feed ('title', 'id', 'author' etc.). \nAfter that, the feed, with only new entries in it is resend to all topic's subscribers. \nBecause of that, the hub cannot process RSS feeds and may have some problems with \nnon-well formated feeds. I'll try to fix this in the future releases.\nIf the subscriber supplied a value for 'hub.secret' in their subscription request, \nthe hub will generate an HMAC signature of the payload and include that signature in \nthe response headers ('X-Hub-Signature') of the notification.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fwebglue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzh%2Fwebglue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzh%2Fwebglue/lists"}