Compare commits

..

3 Commits

Author SHA1 Message Date
ekzyis
8a86cf02a8 Use twiiit.com 2025-12-05 23:37:43 +01:00
6dbf91c9e4 Update to snappy v0.8.2 2025-12-02 19:50:38 +00:00
987b0e8db7 Update to snappy v0.8.1 2025-12-02 16:04:19 +00:00
3 changed files with 6 additions and 11 deletions

2
go.mod
View File

@ -3,7 +3,7 @@ module git.ekzyis.com/ekzyis/unpaywall
go 1.21.0
require (
github.com/ekzyis/snappy v0.5.4
github.com/ekzyis/snappy v0.8.2
github.com/mattn/go-sqlite3 v1.14.17
)

4
go.sum
View File

@ -1,5 +1,5 @@
github.com/ekzyis/snappy v0.5.4 h1:MLHK4fLwYUneAxnlzHoTApNXqZdv8UeO0Xly9LoGYjA=
github.com/ekzyis/snappy v0.5.4/go.mod h1:UksYI0dU0+cnzz0LQjWB1P0QQP/ghx47e4atP99a5Lk=
github.com/ekzyis/snappy v0.8.2 h1:fT+IekT9QMg82waxfo5Qtutb5pZIJDTiw/iK0kYhRKs=
github.com/ekzyis/snappy v0.8.2/go.mod h1:UksYI0dU0+cnzz0LQjWB1P0QQP/ghx47e4atP99a5Lk=
github.com/mattn/go-sqlite3 v1.14.17 h1:mCRHCLDUBXgpKAqIKsaAaAsrAlbkeomtRFKXh2L6YIM=
github.com/mattn/go-sqlite3 v1.14.17/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
gopkg.in/guregu/null.v4 v4.0.0 h1:1Wm3S1WEA2I26Kq+6vcW+w0gcDo44YKYD7YIEJNHDjg=

11
main.go
View File

@ -19,12 +19,7 @@ type NostrClient struct {
var (
TwitterUrlRegexp = regexp.MustCompile(`(?:https?:\/\/)?(?:www\.)?((?:twitter|x)\.com)\/\w+\/status(?:es)?\/\d+`)
// references:
// - https://github.com/zedeus/nitter/wiki/Instances
// - https://status.d420.de/
NitterClearnetUrls = []string{
"xcancel.com",
}
NitterDomain = "twiiit.com"
)
func WaitUntilNext(d time.Duration) {
@ -57,9 +52,9 @@ func main() {
var comment string
if m = TwitterUrlRegexp.FindStringSubmatch(item.Url); m != nil {
comment = strings.Replace(m[0], m[1], "xcancel.com", 1)
comment = strings.Replace(m[0], m[1], NitterDomain, 1)
} else if m = TwitterUrlRegexp.FindStringSubmatch(item.Text); m != nil {
comment = strings.Replace(m[0], m[1], "xcancel.com", 1)
comment = strings.Replace(m[0], m[1], NitterDomain, 1)
}
if comment != "" {