Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions covfefe/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
twitter.db*
creds.json
twitter-media
cmd/covfefe/covfefe
cmd/enroll/enroll
cmd/webfefe/webfefe
9 changes: 9 additions & 0 deletions covfefe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# covfefe

## Usage

1. create app https://developer.twitter.com/en/portal/dashboard
2. grab API_KEY and API_SECRET and populate creds.json based on creds.json.example
3. enable OAuth 1.0a with Callback URI of http://localhost:6052/callback and website http://example.com
4. go run cmd/enroll/main.go
5. go run cmd/covfefe/main.go
2 changes: 1 addition & 1 deletion covfefe/cmd/webfefe/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"crawshaw.io/sqlite/sqlitex"
"filippo.io/mostly-harmless/covfefe"
"filippo.io/mostly-harmless/covfefe/cmd/webfefe/data"
twitterLogin "github.com/dghubble/gologin/twitter"
twitterLogin "github.com/dghubble/gologin/v2/twitter"
"github.com/dghubble/oauth1"
twitterOAuth1 "github.com/dghubble/oauth1/twitter"
"github.com/gorilla/sessions"
Expand Down
4 changes: 2 additions & 2 deletions covfefe/cmd/webfefe/twitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"filippo.io/mostly-harmless/covfefe"
"github.com/dghubble/go-twitter/twitter"
oauth1Login "github.com/dghubble/gologin/oauth1"
twitterLogin "github.com/dghubble/gologin/twitter"
oauth1Login "github.com/dghubble/gologin/v2/oauth1"
twitterLogin "github.com/dghubble/gologin/v2/twitter"
"github.com/dghubble/oauth1"
"github.com/sirupsen/logrus"
)
Expand Down
2 changes: 2 additions & 0 deletions covfefe/covfefe.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func Run(dbPath, mediaPath string, creds *Credentials) error {
}
defer db.Close()

_ = os.MkdirAll(mediaPath, 0700)

c := &Covfefe{
withConn: func(f func(conn *sqlite.Conn) error) error {
conn := db.Get(context.Background())
Expand Down
5 changes: 5 additions & 0 deletions covfefe/creds.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"API_KEY": "...",
"API_SECRET": "...",
"Accounts": []
}
55 changes: 32 additions & 23 deletions covfefe/go.mod
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
module filippo.io/mostly-harmless/covfefe

go 1.17

require (
crawshaw.io/iox v0.0.0-20181124134642-c51c3df30797 // indirect
crawshaw.io/sqlite v0.1.3-0.20190227200648-22f24e1db70c
github.com/cenkalti/backoff v2.1.1+incompatible // indirect
github.com/dghubble/go-twitter v0.0.0-20190108053744-7fd79e2bcc65
github.com/dghubble/gologin v2.1.0+incompatible
github.com/dghubble/oauth1 v0.5.0
github.com/dghubble/sling v1.2.0 // indirect
github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff
github.com/google/go-querystring v1.0.0 // indirect
github.com/gorilla/sessions v1.1.3
github.com/h2non/filetype v1.0.6
github.com/pkg/errors v0.8.1
github.com/schollz/progressbar/v2 v2.9.1
github.com/shurcooL/httpfs v0.0.0-20181222201310-74dc9339e414
github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
github.com/sirupsen/logrus v1.3.0
github.com/stretchr/testify v1.3.0 // indirect
github.com/v2pro/plz v0.0.0-20180227161703-2d49b86ea382
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421
golang.org/x/sync v0.0.0-20190423024810-112230192c58
golang.org/x/tools v0.0.0-20190508150211-cf84161cff3f // indirect
crawshaw.io/sqlite v0.3.2
github.com/dghubble/go-twitter v0.0.0-20220413154426-14d8abde2e80
github.com/dghubble/gologin/v2 v2.3.0
github.com/dghubble/oauth1 v0.7.1
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/gorilla/sessions v1.2.1
github.com/h2non/filetype v1.1.3
github.com/modern-go/gls v0.0.0-20220109145502-612d0167dce5
github.com/pkg/errors v0.9.1
github.com/schollz/progressbar/v2 v2.15.0
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
github.com/sirupsen/logrus v1.8.1
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
)

go 1.12
require (
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/dghubble/sling v1.4.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.25.0 // indirect
)
459 changes: 407 additions & 52 deletions covfefe/go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion covfefe/rescan.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (

"crawshaw.io/sqlite"
"crawshaw.io/sqlite/sqlitex"
"github.com/modern-go/gls"
"github.com/pkg/errors"
"github.com/schollz/progressbar/v2"
log "github.com/sirupsen/logrus"
"github.com/v2pro/plz/gls"
)

func Rescan(dbPath string) (err error) {
Expand Down