-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
25 lines (18 loc) · 722 Bytes
/
example.php
File metadata and controls
25 lines (18 loc) · 722 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?php
// simple example for the PHP pubsubhubbub Subscriber
// as defined at http://code.google.com/p/pubsubhubbub/
// written by Josh Fraser | joshfraser.com | josh@eventvue.com
// written by CureSabs | saba.ad1357@gmail.com
// Released under Apache License 2.0
include("./src/Subscriber.php");
use \Pubsubhubbub\Subscriber\Subscriber;
$hub_url = "http://pubsubhubbub.appspot.com";
$callback_url = "put your own endpoint here";
$feed = "http://feeds.feedburner.com/onlineaspect";
$secret = "your-very-random-string";
// create a new subscriber with secret
$s = new Subscriber($hub_url, $callback_url, false, $secret);
// subscribe to a feed
$s->subscribe($feed);
// unsubscribe from a feed
$s->unsubscribe($feed);