Initial commit.

This commit is contained in:
2026-08-05 12:06:46 +05:00
commit f37a1422e2
21 changed files with 1026 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
package fixers
type fixerFunc func(title, body string) (string, string)
var fixers = map[string]fixerFunc{
"www.opennet.ru": opennetFixer,
}
// Fix fixes title and body depending on site parsed.
func Fix(domain, title, body string) (string, string) {
fixer, found := fixers[domain]
if !found {
return title, body
}
return fixer(title, body)
}
+17
View File
@@ -0,0 +1,17 @@
package fixers
import "strings"
func opennetFixer(title, body string) (string, string) {
newBody := &strings.Builder{}
for line := range strings.Lines(body) {
if strings.HasPrefix(line, "Источник") {
continue
}
_, _ = newBody.WriteString(line)
}
return title, newBody.String()
}