Skip to content

Commit a2a4db6

Browse files
committed
Fix example code.
1 parent d9543e1 commit a2a4db6

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,19 @@ It was written by Josh Fraser (joshfraser.com) and is released under the Apache
55
# Usage
66

77
```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);
2523
```

0 commit comments

Comments
 (0)