mirror of
https://github.com/aljazceru/crawler_v2.git
synced 2025-12-17 07:24:21 +01:00
increased and organized event kinds
Archiver stopped saving regular events
This commit is contained in:
@@ -89,7 +89,7 @@ func Archiver(
|
||||
|
||||
switch {
|
||||
case nostr.IsRegularKind(event.Kind):
|
||||
return store.Save(opctx, event)
|
||||
return nil // do nothing
|
||||
|
||||
case nostr.IsReplaceableKind(event.Kind):
|
||||
replaced, err := store.Replace(opctx, event)
|
||||
|
||||
@@ -19,10 +19,7 @@ type FetcherConfig struct {
|
||||
|
||||
func NewFetcherConfig() FetcherConfig {
|
||||
return FetcherConfig{
|
||||
Kinds: []int{
|
||||
nostr.KindProfileMetadata,
|
||||
nostr.KindFollowList,
|
||||
},
|
||||
Kinds: profileKinds,
|
||||
Relays: defaultRelays,
|
||||
Batch: 100,
|
||||
Interval: time.Minute,
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
"slices"
|
||||
"time"
|
||||
|
||||
"github.com/nbd-wtf/go-nostr"
|
||||
@@ -40,6 +41,37 @@ var (
|
||||
"wss://zap.watch",
|
||||
"wss://satsage.xyz",
|
||||
}
|
||||
|
||||
contentKinds = []int{
|
||||
nostr.KindTextNote,
|
||||
nostr.KindComment,
|
||||
nostr.KindArticle,
|
||||
20, // Picture Event
|
||||
21, // Video Event
|
||||
22, // "Tik-Tok" Video Event
|
||||
}
|
||||
|
||||
engagementKinds = []int{
|
||||
nostr.KindReaction,
|
||||
nostr.KindRepost,
|
||||
nostr.KindGenericRepost,
|
||||
nostr.KindZap,
|
||||
nostr.KindNutZap,
|
||||
}
|
||||
|
||||
profileKinds = []int{
|
||||
nostr.KindProfileMetadata,
|
||||
nostr.KindFollowList,
|
||||
nostr.KindMuteList,
|
||||
nostr.KindRelayListMetadata,
|
||||
nostr.KindUserServerList,
|
||||
}
|
||||
|
||||
allKinds = slices.Concat(
|
||||
contentKinds,
|
||||
engagementKinds,
|
||||
profileKinds,
|
||||
)
|
||||
)
|
||||
|
||||
type FirehoseConfig struct {
|
||||
@@ -50,10 +82,7 @@ type FirehoseConfig struct {
|
||||
|
||||
func NewFirehoseConfig() FirehoseConfig {
|
||||
return FirehoseConfig{
|
||||
Kinds: []int{
|
||||
nostr.KindProfileMetadata,
|
||||
nostr.KindFollowList,
|
||||
},
|
||||
Kinds: allKinds,
|
||||
Relays: defaultRelays,
|
||||
Offset: time.Minute,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user