specifically, comments and posts saved to your reddit user profile can be pulled into pinboard through this project. the following information is pulled down and used when pinning to pinboard:
- subreddit (becomes a tag)
- post title (becomes title)
- post description, if it exists (becomes description)
- post url (becomes url)
the tag "added-by-pynnit" is also added to each entry moved to pinboard in this way. This allows for easy viewing of all imported links. I found this very useful when I was writing the script in the first place, but you may not want it.
I use `pipenv` pretty exclusively because of how it works with my editor. that's the only package manager i've actually tested with, but theoretically the typical `pip install -r requirements.txt` should work just fine.
To be specific, this allows you to update tags _in bulk_; if you have 80 items under the 'clothing' tag, and 40 items under the 'clothes' tag you can combine them by running this code
You will then be asked for the tag you want to replace, and what you want to replace it with. This is an entirely `pinboard` side operation; there's no technical reason that the reddit information should be required, I just haven't split that off the main loop yet. As long as the flags are present & the `pb-apikey` is correct you will be able to update tags. You will not need _accurate_ reddit creds for this operation. This will eventually be fixed!
Thanks to [@micah](https://me.micahrl.com/) for this. I can't believe there's still so much I don't know about `pdb`!! The `-d` flag will do nothing unless the script encounters an exception. If it does, it'll dump you into the `pdb.pm()` dbg repl. Its SUPER useful while you're tweaking stuff / catching idiot mistakes with your password/mfa/whatever.
if you don't have MFA set up for your account (you should do that) then this is easy. everything works as expected. BUT if you DO have MFA set up let me tell you: this gets dumber. when you enter your reddit password you have to also include an active MFA 6 digit code, like this:
This is slow. The API docs published by pinboard require that you only make a call once per 3 seconds, so if you're adding a lot of entries at once (say, during the intial move over) this can take a while, but its still fast enough for my purposes.
So, there are multiple kinds of reddit posts, and each kind of reddit post seems to have distinct names for the same things, which is REALLY fucking annoying. Its extra frustrating because there's not just a quick lookup for this, you have to just dig through Too Much json.
If you're using PRAW, a reddit /post/ has an attribute called `.is_self` that's boolean. If its true, its a text only post, if its false then its a link post.