increase last to 1000 for reply rss, add to readme
This commit is contained in:
@@ -446,6 +446,7 @@ Sort can be `time`, `active` or `score`. Supported sort order with prefix -/+, i
|
||||
|
||||
* `GET /api/v1/rss/post?site=site-id&url=post-url` - rss feed for a post
|
||||
* `GET /api/v1/rss/site?site=site-id` - rss feed for given site
|
||||
* `GET /api/v1/rss/reply?site=site-id&user=user-id` - rss feed for replies to user's comments
|
||||
|
||||
### Admin
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
const maxRssItems = 20
|
||||
const maxLastCommentsReply = 100
|
||||
const maxLastCommentsReply = 1000
|
||||
const maxReplyDuration = 30 * time.Minute
|
||||
|
||||
// ui uses links like <post-url>#remark42__comment-<comment-id>
|
||||
@@ -104,7 +104,6 @@ func (s *Rest) rssRepliesCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
return nil, errors.Wrap(e, "can't get last comments")
|
||||
}
|
||||
comments = s.adminService.alterComments(comments, r)
|
||||
|
||||
replies := []store.Comment{}
|
||||
for _, c := range comments {
|
||||
if len(replies) > maxRssItems || c.Timestamp.Add(maxReplyDuration).Before(time.Now()) {
|
||||
|
||||
+5
-2
@@ -99,13 +99,16 @@ PUT {{host}}/api/v1/admin/user/disqus_grigorybakunov?site=remark&block=0
|
||||
GET {{host}}/api/v1/admin/blocked?site={{site}}
|
||||
|
||||
### delete comment by id
|
||||
DELETE {{host}}/api/v1/admin/comment/3665976683?site=remark&url={{url}}
|
||||
DELETE {{host}}/api/v1/admin/comment/3665976683?site={{site}}&url={{url}}
|
||||
|
||||
### get post info
|
||||
GET {{host}}/api/v1/info?site={{site}}&url=https://radio-t.com/p/2018/05/08/prep-597/
|
||||
|
||||
### post rss
|
||||
GET {{host}}/api/v1/rss/post?site=remark&url={{url}}
|
||||
GET {{host}}/api/v1/rss/post?site=={{site}}&url={{url}}
|
||||
|
||||
### reply rss
|
||||
GET {{host}}/api/v1/rss/reply?site=radiot&user=github_ef0f706a79cc24b17bbbb374cd234a691d034128
|
||||
|
||||
### site rss
|
||||
PUT {{host}}/api/v1/rss/site?site=remark
|
||||
|
||||
Regular → Executable
+1
-2
@@ -5,8 +5,7 @@ BACKUP_PATH=${BACKUP_PATH:-./var}
|
||||
echo "unpack $1"
|
||||
gunzip -c ${BACKUP_PATH}/$1 >/tmp/backup.remark
|
||||
|
||||
size=`stat -c "%s" /tmp/backup.remark`
|
||||
echo "source file size ${size}"
|
||||
ls -la /tmp/backup.remark
|
||||
|
||||
curl -X POST -H "Content-Type: application/json" --data-binary @/tmp/backup.remark "http://127.0.0.1:8081/api/v1/admin/import?site=${2}&provider=native&secret=${SECRET}"
|
||||
rm /tmp/backup.remark
|
||||
|
||||
Reference in New Issue
Block a user