You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.1 KiB
59 lines
1.1 KiB
# %%
|
|
#from arena import Arena
|
|
from dotenv import load_dotenv
|
|
load_dotenv()
|
|
|
|
import os
|
|
import datetime
|
|
import requests
|
|
from bs4 import BeautifulSoup
|
|
import pinboard
|
|
from markdownify import markdownify
|
|
|
|
|
|
#%%
|
|
now= datetime.datetime.now()
|
|
arena_queue = []
|
|
timestamp = now.strftime('%Y.%m.%d-%H:%M')
|
|
|
|
# %%
|
|
pins = pinboard.Pinboard(os.environ['PINBOARD_TOKEN'])
|
|
|
|
# %%
|
|
|
|
tagged_pins = pins.posts.all(tag=["book"])
|
|
|
|
# %%
|
|
|
|
for pin in tagged_pins:
|
|
print(pin.url)
|
|
|
|
# pin.description, pin.extended, pin.time
|
|
|
|
# %%
|
|
|
|
# def import_metadata(post):
|
|
# date = post['date']
|
|
# link = post['post_url']
|
|
# t = post['type']
|
|
# import_info = f'\n------------\n' \
|
|
# f'Imported from Tumblr on: {timestamp} \n' \
|
|
# f'Originally posted as a {t} on {date} \n' \
|
|
# f'{link}'
|
|
# return import_info
|
|
|
|
|
|
#%%
|
|
# Are.na posting
|
|
|
|
# url = "https://api.are.na/v2/channels/automation_inbox/blocks"
|
|
|
|
# arena_queue.reverse()
|
|
|
|
# print('Posting ' + str(len(arena_queue)) + ' blocks')
|
|
|
|
# for block in arena_queue:
|
|
# block['access_token'] = os.environ['ARENA_TOKEN']
|
|
# x = requests.post(url, data=block)
|
|
|
|
# print('Done')
|