Commit Graph

47 Commits

Author SHA1 Message Date
Julien Bisconti acd5a5dab3 test: replace usage of GoPackagePath with PkSourceRoot 2024-01-14 09:45:59 -08:00
Alexandre Viau fb961cf310
make codebase go-vet-clean (#1379)
Co-authored-by: Bob Glickstein <bobg@emphatic.com>
2021-07-26 21:19:53 -04:00
Angel 3dbb01138f pkg/importer: add "instapaper" importer for Instapaper service
A working importer for the Instapaper service. The importer imports
bookmarks, full text articles, and highlights. A blob item handler for
Instapaper highlight permanodes is included to show summarized highlight
content from the server UI.

Also, this CL updates github.com/garyburd.com/go-auth to rev
bca2e7f09a178fd36b034107a00e2323bca6a82e in order to get support for
XAuth requests.

Fixes #1208

Change-Id: I72e0c40b245c7eec4a44bb475fcaa96a0ee9a1c5
2018-11-26 07:57:08 -05:00
Brad Fitzpatrick 2c05f1a3d9 importer: refresh importer root page, add Titles, Descriptions, TODO bugs
And also speed up /importer/TYPE page's query by saying it's unsorted, which
gets us a better index. Hacky workaround. Should fix it in the query planner
later instead.

Fixes #1105

Change-Id: I140ffb40456ec802844584568d2f1a7a38b26e41
2018-04-27 17:06:59 -07:00
Brad Fitzpatrick bc24f7920a importer: change some camlistore.org to perkeep.org; fix devcam --makethings
Change-Id: I517a77a5ef2dd7495402c1357f99a6223fe8481a
2018-04-25 13:23:18 -07:00
Brad Fitzpatrick ab797685bf importer: rename foursquare to swarm, add Properties to Importer interface
Foursquare was rebranded Swarm (for check-ins) some time ago, so
rename our implementation to match the upstream branding. But still
store "foursquare" as the permanode importer type, to not break old
users. That override is now added to the new Properties struct, and
all importers now return their properties.

More stuff will be added to Properties later: WIP flag, bug link,
proper title, icon?

Change-Id: I31cbe2feec3dbf9c6bdb0c866056d9c6966313e3
2018-04-22 11:29:50 -07:00
Paul Lindner 459c75410e all: more renaming of Camlistore to Perkeep
Change-Id: I118e3cbcf20d80afeffc84f001388c4556f21628
2018-01-30 03:02:56 -08:00
Brad Fitzpatrick 194d4f9443 blobserver, all: add contexts to ReceiveBlob, Fetch & million resulting deps
I had intended for this to be a small change.

I was going to just add context.Context to the BlobReceiver interface,
but then I saw blob.Fetcher could also use one, so I decided to do two
in one CL.

And then it got a bit infectious and ended up touching everything.

I ended up doing SubFetch in the process by necessity.

At a certain point I finally started using context.TODO() in a few
spots, but not too many. But removing context.TODO() will come in the
future. There are more blob storage interfaces lacking context, too,
like RemoveBlobs.

Updates #733

Change-Id: Idf273180b3f8e397ac5929c6d7f520ccc5cdce08
2018-01-18 16:22:16 -08:00
Paul Lindner 463832ed76 clients/web/embed: Move vendor/embed to clients/web/embed and adjust paths
Addresses #889
Fixes #1024

Change-Id: I9fa1dc246b0a3a1a4e4ec7abab0a7828fdfdb41e
2018-01-09 22:33:03 +00:00
Brad Fitzpatrick 9265c980de all: change github.com/camlistore/camlistore to github.com/perkeep/perkeep
Change-Id: I0d612bf450e9e8d9ce0767c5a0cb0c44c0d8704f
2018-01-05 19:49:59 -08:00
Brad Fitzpatrick c3d05cdce9 Move more packages out of pkg/ and into internal/
Moved hashutil, httputil, osutil, netutil,
images, media, magic, video, and rollsum.
2018-01-02 21:03:30 -08:00
Brad Fitzpatrick d6a0b05df0 Rename import paths from camlistore.org to perkeep.org.
Part of the project renaming, issue #981.

After this, users will need to mv their $GOPATH/src/camlistore.org to
$GOPATH/src/perkeep.org. Sorry.

This doesn't yet rename the tools like camlistored, camput, camget,
camtool, etc.

Also, this only moves the lru package to internal. More will move to
internal later.

Also, this doesn't yet remove the "/pkg/" directory. That'll likely
happen later.

This updates some docs, but not all.

devcam test now passes again, even with Go 1.10 (which requires vet
checks are clean too). So a bunch of vet tests are fixed in this CL
too, and a bunch of other broken tests are now fixed (introduced from
the past week of merging the CL backlog).

Change-Id: If580db1691b5b99f8ed6195070789b1f44877dd4
2018-01-01 16:03:34 -08:00
Paul Lindner c58e07942e all: lint fixes for "if block ends with a return statement"
Change-Id: I1c244f14995478860c19695695f287d541a7a39c
2017-12-13 11:31:25 -08:00
Paul Lindner ba92702834 all: lint fixes for "should omit 2nd value from range"
Change-Id: I7bb19d376f96a39ecae7dbdb4d6808f704bae5fb
2017-12-13 11:31:25 -08:00
Paul Lindner 15feaeb24c all: lint fixes for 'error strings should not be capitalized or end with punctuation or a newline'
Change-Id: I9c3766a51ac8be694ae76befff4b6fa9a85e34eb
2017-12-11 06:13:25 -08:00
Brad Fitzpatrick 382794c6ba importer: make RunContext.Context be a read-only accessor
The Picasa importer was deadlocking inside the golang.org/x/oauth2
package because the Picasa code was mutating its parent's context and
accidentally creating a cycle of *oauth2.reuseTokenSource values
(double-acquisition of the reuseTokenSource's sync.Mutex was the
deadlock)

The Picasa code really just wanted to create a subcontext from the
base context, where the subcontext did the oauth2 wrapping, but then
picasa was storing that subcontext in the
camlistore.org/pkg/importer-provided mutable "RunContext" structure's
public, embedded "context.Context" field. Unfortunately, the picasa
importer code had already used that *RunContext (pre-mutation) as the
context.Context for the base HTTP client.

This change changes the camlistore.org/pkg/importer.RunContext to not
have a public embedded Context field. Instead, it only has a read-only
accessor to get at the base context, similar to Go 1.7's
net/http.Request.Context() field. This will prevent this class of
error in the future.

Fixes #698

Change-Id: I9114b64aa1bfd7ea83b36ea1ab18ed88b4a44f7e
2016-04-25 14:30:39 -07:00
mpl 63d6e384bb path fixes for third_party move
A few more left in in misc/docker that I'll do separately

Related: 75d60962f6

Change-Id: Id5f6a3729e33aca97f8664ca8ef91afc64461891
2016-04-21 12:25:17 -07:00
Brad Fitzpatrick 75d60962f6 Move remaining stuff in third_party/* to vendor/*
Change-Id: Ifbcc02817083cba68d8c1acec3e6ec50e8f61149
2016-04-20 16:49:15 -07:00
Will Norris 77ed42edf8 add canonical import paths
The import path was added to the go file that included the package
documentation if one existed.  Otherwise, I used what seemed to be the
primary file for the package.

Fixes #689

Change-Id: If51be0e86529fd6f179e80af6781e639f8550fd2
2016-03-13 19:57:14 -07:00
mpl 718c9d8b63 pkg/importer: use go4.org/ctxutil
side-effect: fix an unchecked type assertion, and use a conventional
key for the HTTP client associated with the context (instead of our own
string).

Change-Id: I2701de3f41f1f1c56fe3b76bbf590c0e5b39bc72
2015-12-16 15:30:09 +01:00
Tamás Gulácsi 9f7e1df32b Remove pkg/context
Use golang.org/x/net/context instead.

Fixes #648.

Change-Id: I676a2f25458be97610a49d6f954f2102cbd373fa
2015-12-12 23:09:02 +01:00
Tamás Gulácsi eedf44ef20 pkg/importer/flickr: fix photosSearchItem unmarshal
As Adrian Tritschler reported, Flickr returns Lat/Long
with inconsistent quoting: 0 / "-32.2".

Also ints ("total", for example) can come in quoted ("6236") and
unquoted (6236) form, too.

This commit utilizes an int and a float32 with specialized Unmarshaler.

Change-Id: Ic559059272ba457860bf56a8671d5abd430eb404
2015-07-08 06:41:11 +02:00
Brad Fitzpatrick 5eeed2aba5 Remove some code.google.com references.
Change-Id: I85ccf92af9389300919eed61f62aae28cc24a820
2014-12-11 17:33:17 +11:00
mpl f75081072d importers: newOauthClient refactoring
Change-Id: Ic5864ab2f7bb63bd801fe965c68b36a245edc447
2014-08-02 01:37:43 +02:00
mpl 6d269cb37b importers: some refactoring around oauthContext
Change-Id: I0a7e1dabb9efdaedbda138cdd1c52afcddee5210
2014-08-02 00:50:00 +02:00
mpl c032a4a8e7 flickr: set primary photo as camliContentImage on album
Change-Id: I3e805e3e64878d7f0057957c0be476a1a613cb21
2014-07-31 23:17:44 +02:00
Brad Fitzpatrick 1ff2918602 importers: add SupportsIncremental accessor
If an importer is efficient at running regularly, it returns true.

If it's not true, the UI won't allow turning on automatic runs.

Flickr doesn't set it (yet).
2014-07-31 11:34:31 -07:00
mpl 28d5307853 flickr: some attributes changes
Also revert Total to an "int string", the doc was a lie and Aaron was
right.

Change-Id: I81ca7c8a3e3141beed1c4a3e5784a590a11f1399
2014-07-30 23:13:57 +02:00
mpl 409ec362e3 importer/flickr: make test data for devcam
A few renamings in flickr.go too.

http://camlistore.org/issue/417

Change-Id: Ied28cfadc7a546f34b87f9a43462f82ee4cb71d6
2014-07-29 00:22:06 +02:00
mpl 7e86255cac importer/flickr: set DateCreated attribute
Also cleaned up a few vars.
Moved some attributes to nodeattr pkg.

Change-Id: Iea496d50b12e67132fe88f371a89534c2fe32761
2014-07-25 00:57:10 +02:00
mpl 2504230fb9 importer: update flickr
Works but only lightly tested.
Could use lots of refactoring with code common with twitter.
Needs a test too.

Change-Id: I07f72d29acbc0226aeeedba0afe0bf7eeeac5ad3
2014-05-20 01:40:52 +02:00
Brad Fitzpatrick a90879bac0 Merge branch 'master' of https://camlistore.googlesource.com/camlistore 2014-03-21 13:57:07 -07:00
Aaron Boodman 2802cfb95c Minor cleanup to importer README files.
Change-Id: Id37ed68b5b8eefe9bc0011452a0e41f70466d87b
2014-03-21 13:41:16 -07:00
Brad Fitzpatrick bf692123bf importer: use context.Context instead of Interrupt type
Change-Id: I79f93c6a14934320022b90500d926453e614d001
2014-03-21 12:27:06 -07:00
Brad Fitzpatrick eb27581da7 httputil: add DecodeJSON and CloseBody helpers, then use them everywhere
httputil.CloseBody closes a http.Response.Body nicely, such that it's
more likely to be re-used.

httputil.DecodeJSON parses JSON from a Response.Body and closes the
body. It also keeps a temporary copy of the input, for error messages.

Then use them everywhere, to improve HTTP TCP connection re-use.

And misc other clean-ups.

Change-Id: I5dc44be0165b13659459ed29ce5ab44c17d9739f
2014-01-28 22:00:52 -08:00
Aaron Boodman 88973d4871 Clarify confusing log message in Flickr importer
Change-Id: I9201bd12e7afb31c08b34b4bc4cd7c39567de296
2013-12-27 00:02:33 -08:00
Dan Pupius bdcf858a0c Flickr importer paginates on sets and photostream
Change-Id: I921400958e97c97467f6ef4d3eec642b81a8e614
2013-12-16 21:16:18 -08:00
Brad Fitzpatrick 22101b61d8 flickr: clarify in README that the flag is a devcam flag, not server flag
Change-Id: Iaab951c326ff90f09b6751f8fe4d439743a5e430
2013-12-12 15:39:44 +04:00
Aaron Boodman 6a5a2d6d7c Add a README for the flickr importer package
Change-Id: I018c1574e231cae4119fb55ceb7b63d976db0074
2013-12-10 21:35:58 -08:00
Aaron Boodman 9855ab281d Flickr importer: import sets and populate with links to photos.
Change-Id: I6c53dade3e96373fb3fb9ea4b172c53d5e22d988
2013-11-22 12:21:03 -08:00
Aaron Boodman 08ea4ed13e Flickr importer: Don't refetch or import unmodified photos.
Change-Id: I2ade0aa70e3caca8c3c1153ffee448d09d819da6
2013-11-22 10:13:21 -08:00
Aaron Boodman 93b0bbbee5 Flickr importer: store credentials in Camlistore, not weird JSON file.
Change-Id: I07ed4e9043c9fa448425144886dc3b7047c4e85b
2013-11-22 09:50:03 -08:00
Aaron Boodman 2a747ccd56 Add ability to specify flickr config for devcam.
Change-Id: Ic1139730d969558e2d6375dd86c6741e3dfd2b9b
2013-11-18 21:16:09 -08:00
Aaron Boodman e3d71c34d1 Actually import the first 100 photos from Flickr.
Currently this just imports the title, description, and image data.

Change-Id: I95de17cddb0ac18eec05f8ee288764b04cd7f406
2013-11-17 21:58:06 -08:00
Aaron Boodman de9e5103e7 Grab the userID from the flickr oauth handshake.
Remove the mutex from auth.go because I believe the
mutex in importer.go should guaranteeing only one
flickr importer is running at a time.

Change-Id: Ice971c6c041cf21fdb2bc93cb15f861dd1c8c1d7
2013-11-17 14:26:42 -08:00
Aaron Boodman 9ae23e52b0 Rearrange the Flickr importer to use OAuth instead of Flickr's custom importer.
Change-Id: I8284431fa6572a08d3c7ff0d0e655297627a4eda
2013-11-16 22:30:21 -08:00
Aaron Boodman e4f25a2444 First little bit of Flickr importer.
Change-Id: Ia42b07a81b01904f5722d06653c4bf9de2e81c64
2013-10-20 11:18:53 -07:00