coteh / gyroid Goto Github PK
View Code? Open in Web Editor NEW:bookmark: Command line Pocket refinement tool
License: MIT License
:bookmark: Command line Pocket refinement tool
License: MIT License
Retrieve
endpoint allows you to retrieve articles in the following sorted orders: newest
, oldest
, title
, and site
. Add support for all of these orderings plus an additional random
ordering as well.
A preferences JSON/YML file can be used for the user to specify which sorting they want to use.
Can also add an ordering preference to sort by expected read time if #3 is done.
Last time I checked, I did not appear to have any issue with creating and retrieving config file using os/user
despite what I'm reading online about os/user
not working on Darwin systems due to cgo
. Investigate this, and consider changing the utility function for getting home directory if it does work on Darwin (and Windows and Linux).
Alternative would be to use https://github.com/mitchellh/go-homedir
One I can think of off the top of my head that I've encountered:
Create new issues for some of these types of edge cases if necessary. If this project is switching to go-pocket (#7), then we might not need to do anything if that library already handles such cases.
This issue can be used for considering which additional tag capabilities from the Pocket API to incorporate into this app. (remove tags, replace tags, clear tags, rename tags, delete tags)
New issues can be created for each one if necessary.
Upon adding a new article, ask user if they would like to refine the article on the spot. If yes, then fetch article information from Pocket API and give user the options. Otherwise, it'll just be added like normal (go back to the user's list). This can also be configured within preferences.
Ensure that the async calls we make to Pocket API can correctly return all articles from a user's Pocket list as well as report the total count of articles. Since it's async (ie. in goroutines) we don't have to get this data right away before displaying the first article to the user.
I would like to be able to easily copy a link in the refinement list to the clipboard, as sometimes I would like to take an article off of my Pocket list and into another tool (Todoist, Trello, etc.) right away.
Clipboard
class to copy given stringClipboard
methodCurrently, all untagged articles - the "unrefined" articles - will be loaded on startup. This suits my personal needs, as articles with one or more tags assigned usually means that I have gave some thought as to whether I want to read the article or not.
However, I am considering whether this can be made configurable. Perhaps a refined article to someone else can mean one or more tags and then an additional tag that says "refined"? Maybe something else entirely?
Seems like the articlesList
is being used as a queue. Change it to a queue and add tests.
So not just have untagged articles available, but also have an option to list tagged articles of a specified tag.
Putting this in a separate issue because it can involve creating a preferences JSON/YML that can contain this setting and settings mentioned in other issues.
main
by boolean variableTitle self-explanatory. If they choose not to refine, add it to back of list. If so, keep previous behaviour of putting it in front.
refine-new
set to no
in config)Definitely a UI oversight on my end ๐ When the user reaches the end of their list (or their list is empty), give them a prompt for whether they would like to add an article.
config.yml
: end-of-list-add
(true or false)Thought I made an issue for this already, but guess I didn't. ๐
get
, modify
, add
, and auth endpoints.env
or config.yml
)https://github.com/motemen/go-pocket
Currently, I am connecting to Pocket API directly using Golang's net/http
library as a learning exercise. It might be better to switch over to this library instead. It will require changing all actions and its corresponding tests (mocks will have to be switched out).
go-pocket's CLI uses a fake server to serve a static page upon authentication. The code for it can be seen here. The same can be done for this project to get rid of the Pocket 404 page that displays currently if redirect URI used is invalid.
Found out with testify that you can pass return values into a Call
expectation object and have the mocked method return those arguments, received from the Called()
method.
FailingPocketClientMock
)When #4 is done, it will be a lot easier to load articles and check that we have them in the loaded list of articles already.
In the meantime, this particular problem can be fixed by incrementing the offset passed into GetUntaggedArticles
by 1 whenever an article is added, but this is assuming that:
This can be refined when a better solution can be determined.
I would like to be able to have a small list of quickly accessible shortcuts to assign one or more "quick" tags to an article. (I am currently envisioning this as mapped to characters 0-9)
I can determine the quick tags to be available for me using a config JSON/YML file.
I can type one or more of the characters within the article prompt to assign these tags instantly to the article.
I would like to be able to have the option to quickly delete one or more tags that I'm no longer interested in, in order to keep the number of tags for articles in my Pocket list down to a minimum (allowing for quicker access to tags that I am interested in from the tags list).
Consider allowing users to enforce a limit for number of articles on tag-to-tag basis.
Clipboard suggestion should no longer be suggested once it's added, unless a new URL is copied into the clipboard.
For this command line app, since ideally it'd just be a single user looking at their Pocket list, we can cache the list of articles obtained. We would also cache the timestamp returned from the Retrieve
endpoint indicating the most recent item obtained. Then when user reloads the app, we load all articles since this timestamp and then cache the new results alongside the previous results, so on so forth. If a new session is obtained, then delete the cache unless it's the same user being authenticated as before.
Double check whether there's a property from the Retrieve
endpoint that contains this. If not, a rough estimate can be calculated using the word count and the average number of words per minute that an average person reads.
If there are no untagged articles, still provide user ability to add an article.
Use a library like this one https://github.com/atotto/clipboard
If URL is detected in clipboard (can check first 8 characters or so, for "http://" or "https://") then when user presses + to add article, the URL in their clipboard will be automatically added.
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.circleci/config.yml
codecov 1.0.5
circleci/golang 1.17.5
go.mod
go 1.14
github.com/atotto/clipboard v0.1.4
github.com/stretchr/testify v1.8.1
gopkg.in/yaml.v2 v2.4.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.