diff --git a/parsers/parser.go b/parsers/parser.go index f05db3e..5c4df6d 100644 --- a/parsers/parser.go +++ b/parsers/parser.go @@ -22,10 +22,8 @@ var ( for _, pser := range parsers { if configurable, ok := pser.(parser.ConfigurableParser); ok { cfg := config.C().GetParserConfigByName(configurable.Name()) - if cfg != nil { - if err := configurable.Configure(cfg); err != nil { - fmt.Printf("Error configuring parser %s: %v\n", configurable.Name(), err) - } + if err := configurable.Configure(cfg); err != nil { + fmt.Printf("Error configuring parser %s: %v\n", configurable.Name(), err) } } } diff --git a/parsers/twitter/parser.go b/parsers/twitter/parser.go index 7dd1fd0..231b198 100644 --- a/parsers/twitter/parser.go +++ b/parsers/twitter/parser.go @@ -101,6 +101,11 @@ func (p *TwitterParser) Name() string { } func (p *TwitterParser) Configure(config map[string]any) error { + if config == nil { + p.apiDomain = fxTwitterApi + p.client = *netutil.DefaultParserHTTPClient() + return nil + } if domain, ok := config["api_domain"].(string); ok && domain != "" { p.apiDomain = domain } else {