Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
8a97bebc
Commit
8a97bebc
authored
7 years ago
by
lain
Browse files
Options
Downloads
Patches
Plain Diff
More meta info fixes.
parent
7ccdebe1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/pleroma/web/router.ex
+10
-1
10 additions, 1 deletion
lib/pleroma/web/router.ex
lib/pleroma/web/twitter_api/controllers/util_controller.ex
+34
-7
34 additions, 7 deletions
lib/pleroma/web/twitter_api/controllers/util_controller.ex
with
44 additions
and
8 deletions
lib/pleroma/web/router.ex
+
10
−
1
View file @
8a97bebc
...
...
@@ -23,12 +23,21 @@ def user_fetcher(username) do
plug
:accepts
,
[
"xml"
,
"xrd+xml"
]
end
pipeline
:config
do
plug
:accepts
,
[
"json"
,
"xml"
]
end
scope
"/api"
,
Pleroma
.
Web
do
pipe_through
:
api
pipe_through
:
config
get
"/help/test"
,
TwitterAPI
.
UtilController
,
:help_test
post
"/help/test"
,
TwitterAPI
.
UtilController
,
:help_test
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_and_external_timeline"
,
TwitterAPI
.
Controller
,
:public_and_external_timeline
...
...
This diff is collapsed.
Click to expand it.
lib/pleroma/web/twitter_api/controllers/util_controller.ex
+
34
−
7
View file @
8a97bebc
...
...
@@ -7,12 +7,39 @@ def help_test(conn, _params) do
end
def
config
(
conn
,
_params
)
do
json
(
conn
,
%{
site:
%{
name:
Web
.
base_url
,
server:
Web
.
base_url
,
textlimit:
5000
}
})
case
get_format
(
conn
)
do
"xml"
->
response
=
"""
<config>
<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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment