aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/router.ex1
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api_controller.ex8
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex
index aa2f7865e..c34f03cbb 100644
--- a/lib/pleroma/web/router.ex
+++ b/lib/pleroma/web/router.ex
@@ -30,5 +30,6 @@ defmodule Pleroma.Web.Router do
post "/account/verify_credentials.json", TwitterAPI.Controller, :verify_credentials
post "/statuses/update.json", TwitterAPI.Controller, :status_update
+ get "/statuses/friends_timeline.json", TwitterAPI.Controller, :friends_timeline
end
end
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
index 404afef6d..088439f48 100644
--- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex
+++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex
@@ -24,6 +24,14 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
|> json_reply(200, json)
end
+ def friends_timeline(%{assigns: %{user: user}} = conn, params) do
+ statuses = TwitterAPI.fetch_friend_statuses(user, 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")