obsidian-pocket icon indicating copy to clipboard operation
obsidian-pocket copied to clipboard

Make `ContentType` of Pocket item accessible

Open Superelmanu opened this issue 2 years ago • 9 comments

Could we have an option to import all the articles in MD format when retrieving it from Pocket?

Superelmanu avatar Aug 11 '21 21:08 Superelmanu

Do you mean to automatically create a corresponding note for each Pocket item?

nybbles avatar Aug 12 '21 01:08 nybbles

Sorry for the very bad description. The idea is to be able to important more then just the title and the summary of the article. Having the option to import in a MD format the All article into Obsidian it's basically what I'm asking.

Superelmanu avatar Aug 12 '21 01:08 Superelmanu

Oh I see what you're saying - you want all fields in the article to be available?

The code right now actually does retrieve and store all fields that are exposed by Pocket's API, but only title, URL and excerpt are exposed to the user.

What specific fields are you interested in having access to? I'd need to consider each one, and see how it should be exposed.

nybbles avatar Aug 12 '21 06:08 nybbles

Regarding having all of the metadata in a Markdown file - that's certainly possible - when you create a note for a Pocket item, you can specify a template that's used to create that note.

That template can contain placeholders for title, URL and excerpt (as described in the README). I can add other fields, but would appreciate a specific list.

nybbles avatar Aug 12 '21 06:08 nybbles

Here are a couple of high-level things useful to retrieve. Highlight Tag ContentType :

  • is_article - 0 or 1 - 1 if the item is an article
  • has_image - 0, 1, or 2 - 1 if the item has images in it - 2 if the item is an image
  • has_video - 0, 1, or 2 - 1 if the item has videos in it - 2 if the item is a video

For the ContentType selecting the type to be created as note as an option can be very helpful. Example create notes for all is_article

DetailType :

  • simple = return basic information about each item, including title, url, status, and more
  • complete = return all data about each item, including tags, images, authors, videos, and more

If I understand correctly, you can retrieve form pocket a full article in an MD format, choosing the complete type. Having the option to chose between simple and complete in the plugin can be possible?

Getting all the articles in a markdown form in Obsidian for research, it's very useful.

Superelmanu avatar Aug 12 '21 14:08 Superelmanu

Full article text

This is not actually available in the Pocket retrieve API - it is available as part of a private access API (see https://getpocket.com/developer/docs/v3/article-view), and so it's out of scope for this plugin at the moment. Perhaps once this plugin gets further along, this decision could be revisited and I can talk to Pocket to see if I can get access for this plugin.

Tags

This was just added in #43, although I have to also finish #47 so its usable from the Pocket item note template.

Highlights

This is covered in #34. TBH, due to the complexity it seems to involve (in how to display highlights in Obsidian), I would rather get other pieces of functionality done first.

ContentType

Could you describe how you would use is_article, has_image and has_video, outside of bulk note create (which does not exist yet and I'm not sure if it makes sense to implement it)? Perhaps it would be useful for filtering Pocket items (i.e. when/if search/filter is implemented)?

nybbles avatar Aug 28 '21 00:08 nybbles

I'm going to focus this issue on ContentType, as I am trying to avoid having catch-all issues.

nybbles avatar Aug 28 '21 00:08 nybbles

Hi,

First of all thanks a bunch for making this plugin.

I was wondering if , in addition to the website url , the getpocket url can also be imported. Pocket gives every saved article a unique url like https://getpocket.com/read/xxxxxxxxxx .

Having this url would take the user straight to the article view in pocket.

Thanks again

Cheers

bpriyum avatar Dec 03 '21 15:12 bpriyum

Hello @nybbles I guess you're still looking for somebody to maintain the plugin and unfortunately I'm not a coder but I was wondering if the problem of getting the whole contents of a pocket item could be "work-arounded" by embedding, in the note created from an item, a script that:

  • get the url of the item (better the unique pocket url as it is in a readability format) which can be found in the yaml frontmatter
  • getting the contents of the page (the full text)
  • copying to the clipboard and pasting in the note

Here's an Obsidian Plugin that allows to run shell commands from within a note with the ability of running commands based on certain events What do you all think, guys?

nestor50 avatar Jun 21 '22 09:06 nestor50