1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.Feed.TagController do
6 use Pleroma.Web, :controller
9 alias Pleroma.Web.ActivityPub.ActivityPub
10 alias Pleroma.Web.Feed.FeedView
12 def feed(conn, %{"tag" => tag} = params) do
17 "tag" => parse_tag(tag)
19 |> Map.merge(Map.take(params, ["max_id"]))
20 |> ActivityPub.fetch_public_activities()
23 |> put_resp_content_type("application/atom+xml")
25 |> render("tag.xml", activities: activities, feed_config: Config.get([:feed]))
28 defp parse_tag(raw_tag) when is_binary(raw_tag) do
29 case Enum.reverse(String.split(raw_tag, ".")) do
30 [format | tag] when format in ["atom", "rss"] -> Enum.join(tag, ".")
35 defp parse_tag(raw_tag), do: raw_tag