Compare commits

..

No commits in common. "develop" and "v0.5.3" have entirely different histories.

3 changed files with 11 additions and 6 deletions

2
go.mod
View File

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

4
go.sum
View File

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

11
main.go
View File

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