beaulebens / keyring-social-importers

A collection of importers which pull your content back from social networks, and into your own WordPress install.
32 stars 17 forks source link

Add an importer for Pocket ( getpocket.com ) #25

Closed roccotripaldi closed 5 years ago

roccotripaldi commented 5 years ago

This PR adds a new Keyring importer for Pocket. These instructions assume you have an account with GetPocket.com, and some links saved with said service. This Keyring feature will allow your WordPress site to read from your saved links on GetPocket.com and it will automatically create posts with the content read from your Pocket account.

To test, you'll need both this PR and the corresponding Keyring service.

First, you'll need a testing site, and you'll need to install Keyring plugins with this patch applied:

  1. Download the 2 PRs as zips: [ Download Importer ] [ Download Service ]
  2. Spin up a new jurassic.ninja site
  3. In the site's wp-admin, go Plugins -> Add New and click "Upload Plugin"
  4. Install and activate the Keyring Importer plugin you downloaded in step 1.
  5. Repeat steps 3 & 4 for the Keyring Service plugin you downloaded in step 1.

Next we'll configure and authorize our service:

  1. Go to Tools -> Import and click "Run Importer" for the Pocket importer
  2. Click "Configure Pocket Service"
  3. Follow the instructions to obtain a Consumer Key from your Pocket account.
  4. Click "Back" after you've saved your Consumer Key
  5. Under "Click a service to create a new connection" click Pocket, then click "Authorize"

Now that we have a connection, let's test it!

  1. Click "Test" at the far right of the table containing your newly authorized service
  2. You should get a message saying: "This connection appears to be working."

Now let's import our Pocket links!

  1. Under Tools -> Import, select Pocket
  2. Select the connection you created in the previous steps and click "Continue..."
  3. Set whatever terms you like for the import and click "Start Auto-importing" or "Import All Post (once-off)" depending on how you've configured the import

Did you get any errors during the import? You should have made it to a screen saying "All Done" without any errors.

Check out your new posts in the editor, and on the front end. How do they look?

Each post should have any categories you set during the import configuration.

Each post should have any tags you set during the import configuration AND tags that were imported from Pocket.

Each post will have the post format of "link"

Each post should have a title, which will be the title of the link imported from Pocket.

Each post should have content, which will be, at the very least, a single link element which wraps the title of the link, and links to the original page you book marked with Pocket.

A post's content could optionally have an attached image, which links to the original page you book marked with Pocket.

roccotripaldi commented 5 years ago

@beaulebens - would A pocket importer make more sense as a stand-alone companion plugin to Keyring?

beaulebens commented 5 years ago

I think longer term it'd make sense for all of Keyring to be split out more modularly, so that we don't have to ship all of the Services with the core plugin, or all of the importers with the importer bundle. If there was a core plugin and then a series of modular add-ons for different services, I think that'd make a lot more sense; separate out the release cycles, reduce the requirement to install code you're not using, etc etc.

In the meantime, it's pretty reasonable to just keep putting the Services in Keyring, and the importers in Social Importers. Sorry I haven't had a chance to review and merge this yet -- I expect I will get to it within the next couple of weeks.

beaulebens commented 5 years ago

I merged this, with a bunch of changes. Check out out the changeset for details. Major point to note -- it will only import archived links now (to match how Instapaper works). So once you've read something, archive it, and then it'll auto-import.