From 15495edf56ffd4f052c6beae23445ee969ac2a74 Mon Sep 17 00:00:00 2001 From: jowj Date: Fri, 8 Nov 2019 15:18:58 -0600 Subject: [PATCH] Update readme to reflect new mfa experience; clean up orginization. - moved a bunch of shit around to be more readable. --- README.md | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index cbc8837..12e0813 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,11 @@ specifically, comments and posts saved to your reddit user profile can be pulled - 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. -## Using this bullshit -### Installing +## using this bullshit +### installing 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. -### Setting up the environment +### setting up the environment You need several things to use this project: - Reddit username - Reddit password @@ -42,33 +42,17 @@ python main.py python pinboard.py ``` -Pulling reddit posts through the main.py file is very fast. The pinboard step, however, is quite 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. +## background and additional information +### getting data from reddit +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 export your reddit password you have to also include an active MFA 6 digit code, like this: -## Information / my shit -### Outline: -#### Getting data from reddit -- [X] refactor to use praw instead of requests - - praw has more functionality more obviously than I can figure out with requests. - - its aggrevating. -- [X] Figure out how to pull the entire list - - in praw this is done through "limit=None" arg. -- [X] Figure out how to enable pulling NSFW items - - in praw this is actually just done by default -- [X] Figure out how to differentiate between self.posts, link.posts, and comments - - each one will have different fields but REDDIT DOESN'T DOCUMENT THIS - - because reddit is stupid, that's why, i guess. +`export REDDIT_PW='password:123456'` -#### Putting data in pinboard -So far i've done nothing. -- [X] Get auth token to work - - Finally got this to work; I had a fundamental mistunderstanding of what pinboard meant by "method" in the URL. -- [X] Figure out how to pull existing posts -- [X] Figure out how to post an item to my feed as public -- [ ] Figure out how to post an item to my feed as private -- [ ] Enable a conditional; NSFW items get posted as private, regular items as public. -- [X] Iterate through a list. +so good. +### putting data in pinboard +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. -### Information about reddit (i'm so sorry) +### bonus (cursed?) information about reddit (i'm so sorry) 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.