File tree 1 file changed +15
-17
lines changed
1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -5,21 +5,19 @@ It was written by Josh Fraser (joshfraser.com) and is released under the Apache
5
5
# Usage
6
6
7
7
``` php
8
- // specify which hub you want to use. in this case we'll use the demo hub on app engine.
9
- $hub_url = "http://pubsubhubbub.appspot.com/";
10
-
11
- // create a new pubsubhubbub publisher
12
- $p = new Publisher($hub_url);
13
-
14
- // specify the feed that has been updated
15
- $topic_url = "http://www.onlineaspect.com";
16
-
17
- // notify the hub that the specified topic_url (ATOM feed) has been updated
18
- // alternatively, publish_update() also accepts an array of topic urls
19
- if ($p->publish_update($topic_url)) {
20
- echo "$topic_url was successfully published to $hub_url";
21
- } else {
22
- echo "Ooops...";
23
- print_r($p->last_response());
24
- }
8
+ include("subscriber.php");
9
+
10
+ $hub_url = "http://pubsubhubbub.appspot.com";
11
+ $callback_url = "put your own endpoint here";
12
+
13
+ $feed = "http://feeds.feedburner.com/onlineaspect";
14
+
15
+ // create a new subscriber
16
+ $s = new Subscriber($hub_url, $callback_url);
17
+
18
+ // subscribe to a feed
19
+ $s->subscribe($feed);
20
+
21
+ // unsubscribe from a feed
22
+ $s->unsubscribe($feed);
25
23
```
You can’t perform that action at this time.
0 commit comments