diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-03-21 21:09:20 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-03-21 21:09:20 +0100 |
commit | 2db28df4cffa2ef43a84ac68caee6cef24cce19b (patch) | |
tree | 1ea577fe24c3c3a6a8140409401ea367baf1edee /lib/pleroma/web/twitter_api/twitter_api_controller.ex | |
parent | b9d0e34506ed759dfe096242a62078940dc1a8bb (diff) | |
download | pleroma-2db28df4cffa2ef43a84ac68caee6cef24cce19b.tar.gz |
Add public timeline TwAPI.
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api_controller.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index 1f0a547d0..404afef6d 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -16,6 +16,14 @@ defmodule Pleroma.Web.TwitterAPI.Controller do |> json_reply(200, ActivityRepresenter.to_json(activity, %{user: user})) end + def public_timeline(conn, params) do + statuses = TwitterAPI.fetch_public_statuses(params) + {:ok, json} = Poison.encode(statuses) + + conn + |> json_reply(200, json) + end + defp json_reply(conn, status, json) do conn |> put_resp_content_type("application/json") |