1

I need a some help for a what I think is a quick and relatively easy trick to set up using php : deal with Wordpress and Pocket API to automate content curation on my hosted wordpress blog

Context

I'm running a wordpress blog about various topics of my interest.

Besides this, I read a lot of content relative to these topics using a combination of Feedly and Pocket (a the read it later service).

Because I want to keep an organised and self-hosted archive of my good reads, I want to make my Pocket account and my Wordpress blog to communicate efficiently.

Objectives

Using the Pocket and Wordpress API, I want to come up with the following solution :

When I mark a Pocket item as "favorite", publish a new Wordpress post with :

  • Title = item title
  • Content = image from the item (if exists), excerpt of the item + link to original content
  • Tags = all the pocket tags that start with "#"
  • Categories = all the pocket tags that do NOT start with "#"
  • Status = ability to choose between draft or published

Technical aspect

  • The solution would ideally come up as a wordpress plugin. However, if you think about a better and simpler solution, it is OK. I don't want to rely on third party services like IFTTT or Zapier. I need to have a full control on the code doing the trick.

Good to know

  • I've already contacted the Pocket Support Team. They told me that this is achievable using their API

Thanks for the help you could provide me !

  • so what is actually the wordpress specific question here? obviously how to integrate with pocket is not wordpress specific – Mark Kaplun May 7 '17 at 14:49
0

A quick look at the Pocket API, I think you might have to revise the objective.

When I mark a Pocket item as "favorite", publish a new Wordpress post with...

The way the API works is that you would get a list of articles from your wordpress plugin. https://getpocket.com/v3/get

Passing a few parameters like sort, favorite, and since

POST /v3/get HTTP/1.1
Host: getpocket.com
Content-Type: application/json

{"consumer_key":"1234-abcd1234abcd1234abcd1234",
"access_token":"5678defg-5678-defg-5678-defg56",
"sort":"newest",
"favorite":"1",
"since":"_timestamp_",
"detailType":"complete"}

You would want to store a timestamp each time your plugin queries the API, to avoid duplicates.

The detailType:complete will give you the title, tags, categories, images, etc. which you would plug into a custom content-type.

Your plugin could then post a draft of each item, which you could select to publish according to your hearts desire.

The quick and easy will depend on your skill level.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.