From 2fd688da7463538cde6483d0a2f6ffac07c0b606 Mon Sep 17 00:00:00 2001 From: Terence Eden Date: Sun, 12 Nov 2023 09:16:33 +0000 Subject: [PATCH] Fix OTD --- .domains | 0 __pycache__/config.cpython-310.pyc | Bin 0 -> 427 bytes media.py | 14 ++++++++++++++ on_this_day.py | 4 ++-- untappd2mastodon.py | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .domains create mode 100644 __pycache__/config.cpython-310.pyc create mode 100755 media.py diff --git a/.domains b/.domains new file mode 100644 index 0000000..e69de29 diff --git a/__pycache__/config.cpython-310.pyc b/__pycache__/config.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3e5abc5c7ef3a55a27f737b76459ced4912c22fa GIT binary patch literal 427 zcmZ9I%}&BV6osdPh8SIFVsyz;LSn(v(i&p~68wvx0us7urZdwrp`EGBK#@1{m1gTh zn7FbvF4S{#PjbKHp2gw2yW1esqWXajH2~i8VVBw%`0k(+fLkLD}yfAIIKO91x=smD1A(9 z6!!=7q@4;?eK1caDMh$2+t$^5#dH{*zLqvQFTBzY86QMfpRW?vH{?7LI^ry#;YsqUO6M`hi-=t0wTnEV2#Q)hCG87YSb{nL literal 0 HcmV?d00001 diff --git a/media.py b/media.py new file mode 100755 index 0000000..6e328ef --- /dev/null +++ b/media.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +from mastodon import Mastodon +import json +import requests +import config + +# Set up access +mastodon = Mastodon( api_base_url=config.instance, access_token=config.write_access_token ) + +message = "media test" + +media = mastodon.media_post("https://placekitten.com/200", description="Some alt text.") + +mastodon.status_post(status = message) diff --git a/on_this_day.py b/on_this_day.py index ae56d97..27f4575 100755 --- a/on_this_day.py +++ b/on_this_day.py @@ -35,7 +35,7 @@ while (year_counter >= year_joined ) : # Call the API statuses = mastodon.account_statuses(id = my_id, max_id=max_id, min_id=min_id, limit="40", exclude_reblogs=True) # Fetch further statuses if there are any - all_statuses = mastodon.fetch_remaining(statuses) + all_statuses = statuses #mastodon.fetch_remaining(statuses) # Print the date and URl for status in all_statuses : - print( str(status["created_at"])[:16] + " " + BeautifulSoup(status["content"], features="html.parser").get_text() + " - " + status["uri"] ) + print( str(status["created_at"])[:16] + " " + BeautifulSoup(status["content"], features="html.parser").get_text() + " - " + status["uri"] + "\n") diff --git a/untappd2mastodon.py b/untappd2mastodon.py index d667b8a..3b8431f 100755 --- a/untappd2mastodon.py +++ b/untappd2mastodon.py @@ -19,7 +19,7 @@ checkin = untappd_data["response"]["checkins"]["items"][0] untappd_id = checkin["checkin_id"] # Was this ID the last one we saw? -check_file = open("untappd_last", "r+") +check_file = open("untappd_last", "w+") last_id = check_file.read() if (last_id != str(untappd_id) ) :