Handle Twitter duplicates (#20)
This commit adds a hash attribute to help identify duplicate messages. Tweets have a TweetID attribute for the initial thread identifier and a LastTweetID attribute to keep track of the last reply to eventually continue the thread if a duplicate is detected. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
9629483953
commit
1f5cef17d2
6 changed files with 163 additions and 31 deletions
10
utils.go
10
utils.go
|
|
@ -26,3 +26,13 @@ func ContainsString(arr []string, str string) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// CoalesceInt64 returns the first non zero value from variadic int64 arguments
|
||||
func CoalesceInt64(values ...int64) int64 {
|
||||
for _, value := range values {
|
||||
if value != 0 {
|
||||
return value
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue