Giter VIP home page Giter VIP logo

pocketsnack's Introduction

Hello!

๐Ÿค“ I'm a librarian living in Naarm (Melbourne), Australia.
๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป I code mostly for fun and sometimes for work.
๐Ÿ‘ค my pronouns are he/him.
๐Ÿ“š Check out my reading recommendations on Bookwyrm
๐Ÿ’ต If you like something I've made and want to contribute monetarily, please donate to FreeHer instead

Are you an Australian librarian? Please check the Library Map and let me know if you have any of the missing information!

pocketsnack's People

Contributors

dependabot[bot] avatar hughrun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pocketsnack's Issues

pocketsnack everything problem

  • Downloaded pocket-snack.zip
  • Copied (yes, copied, not renamed) settings-example.py to settings.py
  • Added the consumer key where it says to
  • Opened terminal, ran bash install.sh
  • Got the following output
Saorsa:pocket-snack-master Alissa$ bash install.sh
Making executable..
Linking to local binary directory..
ln: /usr/local/bin/pocketsnack: File exists
checking for Python3...
Python 3 is installed and python3 command works
Installation complete โœ… You can now get started!
-------------------------------------------------
Do you want to authorise your app with Pocket now? Choose 1 for Yes or 2 for No
1) Yes
2) No
#? 1
Authorise pocketsnack in the browser window that opens in a moment, then return to this command line to finish setting up.
install.sh: line 19: pocketsnack: command not found
Do you want to automatically refresh your Pocket List? This will run "stash" and then "lucky_dip" once per day, or once per week.
1) No Thanks
2) Yes Daily
3) Yes Weekly
#? 

Again, no browser window pops up to run pocketsnack authorise. You will note this error differs from #18 in that now pocketsnack suddenly doesn't exist at all, despite the code literally not changing.

I'm totally stumped at how the exact same code can produce two totally different errors. Happy Sunday!

include launchd files and cron examples

Instead of including it in the script, we should use cron (server) or launchd (MacOS) to determine when the script runs. Include example launchd files and cron commands for each timing, as well as instructions on how to use them in the README

--dedupe not working

Running pocketsnack --dedupe --all isn't working; when the program asks me to enter 'delete' and I do, I get an error. I also tried entering "delete" with quote marks and got a 'โœ‹ deletion cancelled' response.

image

keep certain tags

It would be really nice if we could keep certain tags, because then we'd be able to provide the option to get rid of all the others. The Pocket API allows us to remove all tags and replace them with one or more new tags.

Unfortunately whilst the Pocket API suggests that "tags" is an array returned when you retrieve articles, it doesn't seem to actually do so - which means we can't tell which tags any article already has. So I'm logging this as an issue but it's probably not solveable.

refresh sometimes fails partway through

Occassionally refresh - or really stash - gets a connection error when attempting to archive items from the list. That is, adding the tbr tag works, but then the connection fails and the operation crashes at the point it attempts to archive items. This also seems to happen for some list items when running stash over a large list.

Possibly this just needs a delay between operations - maybe with an unless... or while... to check a connection can be made successfully.

Settings per content type

Pocket identifies three content types: 'articles', 'videos' and 'images'. It would be good to have an option to include X number of each content type each time the script runs.

make install script smarter

it would be good if install.sh checked the Python version and installed requests if it isn't installed yet.

ignore tag

Provide an option to ignore particular articles rather than moving them from My LIst to Archive.

include setup script

Maybe a Bash file, but it ideally needs to run pocket_tools.authorise, do a first pass of stash and lucky_dip, and set up the cron job or launchd file.

Don't unload plist file if it isn't loaded

Need to add a check to the install.sh script so that unloading the plist only happens if there is one already loaded - otherwise on first install the user gets an opaque (but harmless) error message.

add --tbr argument for --purge

with a --tbr argument for --purge, it would be possible to purge tags only for archived items with the tbr tag. Not sure how much use case there is for this, but it would be more complete.

to-be-archived tag?

Possibly an option to only archive articles that have a particular tag? Basically the opposite of #1 .

Filter items by timestamp

Add an option in settings.py whereby a user can opt to keep everything they've added in the last day/week/month/etc in their list, and stash the rest, or vice versa. Basically an option to filter by timestamp. (Please)

Feature request: apply favourite status to duplicate items

It occurred to me that if I have duplicate items in my pocket, they were probably things I was particularly interested in reading, and it would be handy to mark them in some way before deduping. Would it be possible for pocketsnack to add dupe items to favourites before the deduping happens? (Such that all dupes are favourited, but all bar one are then deleted)

use argparse

Currently passing arguments is pretty messy. Use argparse to make it cleaner.

Terse feedback

When running stash and lucky_dip, it would be cool if it could tell me something like 'X items moved to TBR pile' or 'Y items added to List'. Currently the feedback looks like this:

$ python3 main.py stash
done
$ python3 main.py lucky_dip
None

(I know lucky_dip worked, so I'm not sure why it's saying 'none'?)

414 error if too many items in list

If there are too many items to archive, the URL will be too long and cause a 414 error. Need to batch queries up into smaller numbers (and also provide better error messages).

purge tags

purge function should remove all tags except those listed in an exclusion dictionary.

Broken

The readme suggested I run main.py, so I did that without editing anything but including the stash argument, and got the following error

Saorsa:pocket-snack-master Alissa$ python3 main.py stash
Traceback (most recent call last): 
  File "main.py", line 37, in <module> 
    import settings 
ModuleNotFoundError: No module named 'settings'

Thinking this was because the settings file was actually named settings-example.py, I renamed it settings.py in case that did anything, but got this error instead

Saorsa:pocket-snack-master Alissa$ python3 main.py stash
Traceback (most recent call last):
  File "main.py", line 86, in <module>
    stash = pt.stash(consumer_key, settings.pocket_access_token, archive_tag, settings.replace_all_tags, settings.retain_tags, settings.ignore_faves, settings.ignore_tags)
AttributeError: module 'settings' has no attribute 'pocket_access_token'

Which is weird because it clearly specifies settings.pocket_access_token ???

Ability to dedupe Pocket archive

Pickpocket is great, but it only works on one's pocket list, not archive. It would be useful to be able to dedupe an archive as well (particularly when used in conjunction with pocket-snack)

longreads

Pocket provides a word count for articles. Provide settings allowing the user to define how long a 'long read' is, whether they want to filter by reading length, and if so how many long reads they want per cycle.

install instructions are confusing

The instructions about "moving into the top directory" are a bit unclear.

Also need to add a note about uninstalling previous versions first.

autodelete items from a given domain

Prevent items from a given domain from being added to the list, or otherwise batch-delete them if they do make it to the list.

eg. disallow all items from annoyingblogger.wordpress.com

pocketsnack authorise problem

I copied the consumer key to settings.py as instructed, and when running bash install.sh I select '1' at 'Do you want to authorise your app now' but I get this error instead of a browser popup:

Authorise pocketsnack in the browser window that opens in a moment, then return to this command line to finish setting up.
Traceback (most recent call last):
  File "/usr/local/bin/pocketsnack", line 48, in <module>
    settings.pocket_access_token, 
AttributeError: module 'settings' has no attribute 'pocket_access_token'

And I'm like 'I know, you're meant to authorise me and add the access token to settings.py' but it's not doing that. Running pocketsnack authorise manually returns the same error.

uninstall script

Probably there needs to be an uninstall script or at least some instructions on how to do this, since the executable symlink and plist files should be cleared out to avoid any issues when re-installing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.