kopia lustrzana https://codeberg.org/edent/Mastodon_Tools
Fix OTD
rodzic
576fd84439
commit
2fd688da74
Plik binarny nie jest wyświetlany.
|
@ -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)
|
|
@ -35,7 +35,7 @@ while (year_counter >= year_joined ) :
|
||||||
# Call the API
|
# Call the API
|
||||||
statuses = mastodon.account_statuses(id = my_id, max_id=max_id, min_id=min_id, limit="40", exclude_reblogs=True)
|
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
|
# 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
|
# Print the date and URl
|
||||||
for status in all_statuses :
|
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")
|
||||||
|
|
|
@ -19,7 +19,7 @@ checkin = untappd_data["response"]["checkins"]["items"][0]
|
||||||
untappd_id = checkin["checkin_id"]
|
untappd_id = checkin["checkin_id"]
|
||||||
|
|
||||||
# Was this ID the last one we saw?
|
# 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()
|
last_id = check_file.read()
|
||||||
|
|
||||||
if (last_id != str(untappd_id) ) :
|
if (last_id != str(untappd_id) ) :
|
||||||
|
|
Ładowanie…
Reference in New Issue