diff --git a/mod/profile.php b/mod/profile.php index 9b609f885a..843f06de3e 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -64,7 +64,9 @@ function profile_init(App $a) } $a->page['htmlhead'] .= '' . "\r\n"; - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . ($a->path ? '/' . $a->path : '')); $a->page['htmlhead'] .= '' . "\r\n"; header('Link: <' . System::baseUrl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false); diff --git a/src/Module/Feed.php b/src/Module/Feed.php new file mode 100644 index 0000000000..a8101e8061 --- /dev/null +++ b/src/Module/Feed.php @@ -0,0 +1,53 @@ + posts + * - /feed/[nickname]/posts => posts + * - /feed/[nickname]/comments => comments + * - /feed/[nickname]/replies => comments + * - /feed/[nickname]/activity => activity + * + * @brief Provides public Atom feeds + * + * @author Hypolite Petovan + */ +class Feed extends BaseModule +{ + public static function content() + { + $a = self::getApp(); + + $last_update = x($_GET, 'last_update') ? $_GET['last_update'] : ''; + $nocache = x($_GET, 'nocache') && local_user(); + + $type = null; + if ($a->argc > 2) { + $type = $a->argv[2]; + } + + switch ($type) { + case 'posts': + case 'comments': + case 'activity': + break; + case 'replies': + $type = 'comments'; + break; + default: + $type = 'posts'; + } + + $nickname = $a->argv[1]; + header("Content-type: application/atom+xml"); + echo OStatus::feed($nickname, $last_update, 10, $type, $nocache); + killme(); + } +}