Build out get_all_posts; update readme.

jowj 5 years ago
parent e2b2242312
commit 50cc781149

@ -20,7 +20,9 @@ Do i need to do anything here, actually, or is json fine?
### Putting data in pinboard
So far i've done nothing.
- [ ] Get regular auth to work
- [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
- [ ] 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.

@ -1,10 +1,13 @@
import requests
import os
import pysnooper
pinboard_token = os.environ.get("PINBOARD_TOKEN")
pinboard_user = os.environ.get("PINBOARD_USER")
pinboard_password = os.environ.get("PINBOARD_PASSWORDD")
pinboard_url = f"https://{pinboard_user}:{pinboard_password}"
pinboard_base_url = ""
def get_all_posts():
posts = f"posts/all?auth_token={pinboard_token}"
pinboard_url = pinboard_base_url + posts
return requests.get(pinboard_url)