1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-12-04 14:46:37 -05:00

Updated systems to include list.Item funcs

This commit is contained in:
マリウス 2023-01-04 21:41:41 -05:00
parent 78da08af0b
commit 351049310f
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F
4 changed files with 57 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package discourse
import (
"context"
"fmt"
"net/http"
"strconv"
"time"
@ -63,6 +64,23 @@ func (sys *System) GetCapabilities() []adapter.Capability {
return caps
}
func (sys *System) FilterValue() string {
return fmt.Sprintf(
"Discourse %s",
sys.config["url"],
)
}
func (sys *System) Title() string {
return sys.config["url"].(string)
}
func (sys *System) Description() string {
return fmt.Sprintf(
"Discourse",
)
}
func (sys *System) Load() error {
url := sys.config["url"]
if url == nil {

View File

@ -3,6 +3,7 @@ package hackernews
import (
"context"
"errors"
"fmt"
"strconv"
"time"
@ -62,6 +63,22 @@ func (sys *System) GetCapabilities() []adapter.Capability {
return caps
}
func (sys *System) FilterValue() string {
return fmt.Sprintf(
"Hacker News https://news.ycombinator.com",
)
}
func (sys *System) Title() string {
return "https://news.ycombinator.com"
}
func (sys *System) Description() string {
return fmt.Sprintf(
"Hacker News",
)
}
func (sys *System) Load() error {
sys.client = hn.NewClient()
return nil

View File

@ -2,6 +2,7 @@ package lemmy
import (
"context"
"fmt"
"strconv"
"time"
@ -62,6 +63,23 @@ func (sys *System) GetCapabilities() []adapter.Capability {
return caps
}
func (sys *System) FilterValue() string {
return fmt.Sprintf(
"Lemmy %s",
sys.config["url"],
)
}
func (sys *System) Title() string {
return sys.config["url"].(string)
}
func (sys *System) Description() string {
return fmt.Sprintf(
"Lemmy",
)
}
func (sys *System) Load() error {
var err error

View File

@ -20,6 +20,10 @@ type System interface {
SetLogger(logger *zap.SugaredLogger)
GetCapabilities() []adapter.Capability
FilterValue() string
Title() string
Description() string
Connect(sysURL string) error
Load() error