forked from AkkomaGang/akkoma
More meta info fixes.
This commit is contained in:
parent
7ccdebe180
commit
8a97bebc53
2 changed files with 44 additions and 8 deletions
|
@ -23,12 +23,21 @@ def user_fetcher(username) do
|
||||||
plug :accepts, ["xml", "xrd+xml"]
|
plug :accepts, ["xml", "xrd+xml"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
pipeline :config do
|
||||||
|
plug :accepts, ["json", "xml"]
|
||||||
|
end
|
||||||
|
|
||||||
scope "/api", Pleroma.Web do
|
scope "/api", Pleroma.Web do
|
||||||
pipe_through :api
|
pipe_through :config
|
||||||
|
|
||||||
get "/help/test", TwitterAPI.UtilController, :help_test
|
get "/help/test", TwitterAPI.UtilController, :help_test
|
||||||
post "/help/test", TwitterAPI.UtilController, :help_test
|
post "/help/test", TwitterAPI.UtilController, :help_test
|
||||||
get "/statusnet/config", TwitterAPI.UtilController, :config
|
get "/statusnet/config", TwitterAPI.UtilController, :config
|
||||||
|
get "/statusnet/version", TwitterAPI.UtilController, :version
|
||||||
|
end
|
||||||
|
|
||||||
|
scope "/api", Pleroma.Web do
|
||||||
|
pipe_through :api
|
||||||
|
|
||||||
get "/statuses/public_timeline", TwitterAPI.Controller, :public_timeline
|
get "/statuses/public_timeline", TwitterAPI.Controller, :public_timeline
|
||||||
get "/statuses/public_and_external_timeline", TwitterAPI.Controller, :public_and_external_timeline
|
get "/statuses/public_and_external_timeline", TwitterAPI.Controller, :public_and_external_timeline
|
||||||
|
|
|
@ -7,12 +7,39 @@ def help_test(conn, _params) do
|
||||||
end
|
end
|
||||||
|
|
||||||
def config(conn, _params) do
|
def config(conn, _params) do
|
||||||
json(conn, %{
|
case get_format(conn) do
|
||||||
site: %{
|
"xml" ->
|
||||||
name: Web.base_url,
|
response = """
|
||||||
server: Web.base_url,
|
<config>
|
||||||
textlimit: 5000
|
<site>
|
||||||
}
|
<name>#{Web.base_url}</name>
|
||||||
})
|
<site>#{Web.base_url}</site>
|
||||||
|
<textlimit>5000</textlimit>
|
||||||
|
</site>
|
||||||
|
</config>
|
||||||
|
"""
|
||||||
|
conn
|
||||||
|
|> put_resp_content_type("application/xml")
|
||||||
|
|> send_resp(200, response)
|
||||||
|
_ ->
|
||||||
|
json(conn, %{
|
||||||
|
site: %{
|
||||||
|
name: Web.base_url,
|
||||||
|
server: Web.base_url,
|
||||||
|
textlimit: 5000
|
||||||
|
}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def version(conn, _params) do
|
||||||
|
case get_format(conn) do
|
||||||
|
"xml" ->
|
||||||
|
response = "<version>Pleroma Dev</version>"
|
||||||
|
conn
|
||||||
|
|> put_resp_content_type("application/xml")
|
||||||
|
|> send_resp(200, response)
|
||||||
|
_ -> json(conn, "Pleroma Dev")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue