|
|
|
@ -1,12 +1,17 @@
|
|
|
|
|
from mastodon import Mastodon
|
|
|
|
|
import mimetypes, httpx, os
|
|
|
|
|
import pytumblr2
|
|
|
|
|
import mimetypes
|
|
|
|
|
import httpx
|
|
|
|
|
import os
|
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
|
|
|
|
|
load_dotenv()
|
|
|
|
|
|
|
|
|
|
def mastodon(post):
|
|
|
|
|
|
|
|
|
|
def masto(post):
|
|
|
|
|
mastodon = Mastodon(
|
|
|
|
|
access_token = os.environ.get("MAST_TOKEN"),
|
|
|
|
|
api_base_url = 'https://mastodon.social'
|
|
|
|
|
access_token=os.environ.get("MAST_TOKEN"),
|
|
|
|
|
api_base_url='https://mastodon.social'
|
|
|
|
|
)
|
|
|
|
|
try:
|
|
|
|
|
i = httpx.get(post["image"]).content
|
|
|
|
@ -18,3 +23,16 @@ def mastodon(post):
|
|
|
|
|
print(f'Posted {post["id"]} to Mastodon @wownero')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(e)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def tumblr(post):
|
|
|
|
|
client = pytumblr2.TumblrRestClient(
|
|
|
|
|
os.environ.get("consumer_key"),
|
|
|
|
|
os.environ.get("consumer_secret"),
|
|
|
|
|
os.environ.get("oauth_token"),
|
|
|
|
|
os.environ.get("oauth_secret"),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
client.legacy_create_photo("wownero", state="published", tags=["wownero", "such", "meme", "wow", "memes"], caption=f'New meme by {post["submitter"]}!\n{post["title"]} - {post["text"]}', link=f'{post["href"]}',
|
|
|
|
|
source=post["image"])
|