Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
webclient
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
Service Desk
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
retribute.me
webclient
Commits
feda5102
Verified
Commit
feda5102
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Better handling of toots date
parent
e2741625
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#4241
passed
6 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sources/mastodon.js
+10
-4
10 additions, 4 deletions
src/sources/mastodon.js
with
10 additions
and
4 deletions
src/sources/mastodon.js
+
10
−
4
View file @
feda5102
...
...
@@ -98,14 +98,20 @@ export default {
// results.progress = 0
// results.progressCount
results
.
accounts
=
{}
let
cont
=
true
while
(
cont
)
{
let
tooOld
=
0
let
maxOld
=
5
while
(
tooOld
<
maxOld
)
{
let
response
=
await
client
.
get
(
url
,
{
params
:
{
limit
:
40
}})
response
.
data
.
forEach
((
f
)
=>
{
let
date
=
moment
(
f
.
created_at
)
// ugly hack because we don't have any way to query favorite date, and mastodon
// return toots in reverse favorite date order, so favoriting a very old toot
// can result in little to no suggestions
if
(
date
.
isBefore
(
dateLimit
))
{
cont
=
false
return
tooOld
+=
1
}
else
{
// we reset the counter
tooOld
=
0
}
handledFavorites
+=
1
results
.
progressCount
+=
1
...
...
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