Add friends timeline.
This commit is contained in:
parent
37e443ce6c
commit
e2e0cd75b7
4 changed files with 39 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue