box464, to random
@box464@mastodon.social avatar

I saw a post today about another Mastodon API endpoint that is kind of in a zombie state (I looked into Featured Profiles awhile back).

This one is a “Mastodon Wrapped" end of year review.

On m.s. it's accessible but as expected doesn't return any data. Currently, the admin would have to jump to the console and run a task to populate the reports.

Like other "wrapped" end of year summaries, it's only available to the user.

andypiper, (edited ) to fediverse
@andypiper@macaw.social avatar

Today was a great set of meetings and discussions, moving the #Fediverse forward. Nice to reconnect after too long with @chrismessina - and to meet @snarfed.org@snarfed.org @J12t @anca @frozencanuck in person, lots more connections to make tomorrow. It is an exciting time in the #ActivityPub and #MastodonAPI ecosystem!

Edent, to python
@Edent@mastodon.social avatar

🆕 blog! “Untappd to Mastodon - Updated!”

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying. First up, you'll need a file called config.py to hold all your API keys: instance = "https://mastodon.social" access_token = "…" write_access_token = "…" untappd_client_id = "…" untappd_cli…

👀 Read more: https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

#MastodonAPI #python #untappd

blog, to Untappd
@blog@shkspr.mobi avatar

Untappd to Mastodon - Updated!
https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

A few years ago, I wrote some code to post Untappd check-ins to Mastodon. I've recently updated it to also post a photo of the beer you're enjoying.

First up, you'll need a file called config.py to hold all your API keys:

instance = "https://mastodon.social"access_token          = "…"write_access_token    = "…"untappd_client_id     = "…"untappd_client_secret = "…"

Then a file called untappd2mastodon.py to do the job of grabbing your data, finding your latest check-in, then posting it to the Fediverse:

#!/usr/bin/env python# -*- coding: utf-8 -*-from mastodon import Mastodonimport jsonimport requestsimport config#  Set up accessmastodon = Mastodon( api_base_url=config.instance, access_token=config.write_access_token )#       Untappd APIuntappd_api_url = 'https://api.untappd.com/v4/user/checkins/edent?client_id=' + config.untappd_client_id + '&client_secret='+ config.untappd_client_secretr = requests.get(untappd_api_url)untappd_data = r.json()#       Latest checkin objectcheckin = 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")last_id = int( check_file.read() )print("Found " + str(last_id) )check_file.close()if (last_id != untappd_id ) :        print("Found new checkin")        check_file = open("untappd_last", "w")        check_file.write( str(untappd_id) )        check_file.close()        #       Start creating the message        message = ""        if "checkin_comment" in checkin :                message += checkin["checkin_comment"]        if "beer" in checkin :                message += "nDrinking: " + checkin["beer"]["beer_name"]        if "brewery" in checkin :                message += "nBy: "       + checkin["brewery"]["brewery_name"]        if "venue" in checkin :                if "venue_name" in checkin["venue"] :                        message += "nAt: "       + checkin["venue"]["venue_name"]        #       Scores etc        untappd_checkin_url = "https://untappd.com/user/edent/checkin/" + str(untappd_id)        untappd_rating      = checkin["rating_score"]        untappd_score       = "🍺" * int(untappd_rating)        message += "n" +  untappd_score + "n" + untappd_checkin_url + "n" + "#untappd"        #       Get Image        if checkin["media"]["count"] > 0 :                photo_url = checkin["media"]["items"][0]["photo"]["photo_img_lg"]                download = requests.get(photo_url)                with open("untappd.tmp", 'wb') as temp_file:                        temp_file.write(download.content)                media = mastodon.media_post("untappd.tmp", description="A photo of some beer.")                mastodon.status_post(status = message, media_ids=media, idempotency_key = str(untappd_id))        else:                   #       Post to Mastodon. Use idempotency just in case something went wrong                mastodon.status_post(status = message, idempotency_key = str(untappd_id))else :        print("No new checkin")

You can treat this code as being MIT licenced if that makes you happy.

https://shkspr.mobi/blog/2024/05/untappd-to-mastodon-updated/

#MastodonAPI #python #untappd

andypiper, to random
@andypiper@macaw.social avatar

Co-authored an update from the @MastodonEngineering team with my friend @renchap - a sneak peek at what is coming in 4.3 (and looking ahead from there). We'll aim to make these updates a regular feature for the blog. Let us know what you think! https://blog.joinmastodon.org/2024/05/trunk-tidbits-april-2024/

box464, to random
@box464@mastodon.social avatar

Early morning fun with the Mastodon API and my ridiculous number of bookmarks.

#MastodonAPI

andypiper, to fediverse
@andypiper@macaw.social avatar

This right here is the value of having an open API (and @bardi also makes the point of thanking the folks who help to build TootSDK, as something he built Tusks on top of). What a great app - I just bought myself a license.

https://mas.to/@bardi/112365896372971256

andypiper, to random
@andypiper@macaw.social avatar

This is great - @stefan has done an analysis of folk following his creative bots on Mastodon #mastodondev #mastodonapi https://stefanbohacek.com/blog/analyzing-fediverse-followers/

botwiki, to genart
@botwiki@mastodon.social avatar
Tealk, to mastodon
@Tealk@rollenspiel.social avatar

Does anyone have any ideas on how to solve the problem?

https://codeberg.org/RollenspielMonster/simple-toot/issues/1

andypiper, (edited ) to random
@andypiper@macaw.social avatar

I love this combination of #MastodonAPI and a 📟 hardware hack / reuse! 👏🏻 https://hackaday.com/2024/03/04/pager-lives-again-thanks-to-python-and-mastodon/

DanielBerezhnoy, to swift
@DanielBerezhnoy@mastodon.social avatar

@walleri is finally on the App Store! It's been quite a journey, but I'm so glad it's now available for the whole world to try.

There's still a lot of things I want to improve, but I realized that it's never gonna be perfect and at some point I just have to release it.

Today is that day 🚀

App Store link: https://apps.apple.com/us/app/walleri/id6470121640

Edent, to fediverse
@Edent@mastodon.social avatar

🆕 blog! “ActivityPub Server in a Single PHP File”

Any computer program can be designed to run from a single file if you architect it wrong enough! I wanted to create the simplest possible Fediverse server which can be used as an educational tool to show how ActivityPub / Mastodon works. The design goals were: Upload a single PHP file to the server. No […]

👀 Read more: https://shkspr.mobi/blog/2024/02/activitypub-server-in-a-single-file/

#ActivityPub #mastodon #php

Edent,
@Edent@mastodon.social avatar

But the one thing I can't figure out…

When I mention "@ example @ example.viii.fi", it shows as:

@example

Which links back to the user's website, rather than showing their info within Mastodon.

Which arcane #ActivityPub or #MastodonAPI field do I need to have in my JSON file to fix this?

box464, to mastodon
@box464@mastodon.social avatar

My most popular blog post continues to be about Mastodon Preview Cards generation.

I've updated it to include a few more tidbits:

The image attached to the link must be less than 2 MB in size (the default config from Mastodon) or the image won't be used.

Once a Masotodn server has generated a link preview (image attached or not), it's cached for 14 days before it will attempt to refresh it. This one needs some testing.

https://box464.com/posts/mastodon-preview-cards/

#Mastodon #MastodonAPI

andypiper, to random
@andypiper@macaw.social avatar
Edent, to fediverse
@Edent@mastodon.social avatar

🆕 blog! “Rebuilding FourSquare for ActivityPub using OpenStreetMap”

I used to like the original FourSquare. The "mayor" stuff was a bit silly, and my friends never left that many reviews, but I loved being able to signal to my friends "I am at this cool museum" or "We're at this pub if you want to meet" or "Spendi…

👀 Read more: https://shkspr.mobi/blog/2024/01/rebuilding-foursquare-for-activitypub-using-openstreetmap/

#ActivityPub #fediverse #FOURSQUARE #geolocation #OpenStreetMap

Edent,
@Edent@mastodon.social avatar

Goodness me! The ActivityPub network is chatty.
In the last 6 hours, I've received 371 different messages to my single-user inbox.

Most of which seem to be from servers announcing users have been deleted. They're not users or servers I've seen before.

Is this normal?

#MastoAdmin #MastodonAPI

JSON code showing a user has been deleted.

Edent, to fediverse
@Edent@mastodon.social avatar

I'm trying to accept a follow request from Mastodon.social, but the server keeps coming back with the error "found an invalid character in header name".

I'm sending my response to <https://mastodon.social/users/Edent/inbox>

What trivially obvious thing am I missing?

#MastoAdmin #ActivityPub #MastodonAPI

andypiper, to random
@andypiper@macaw.social avatar

I love niche projects like this - using a Kindle Scribe to update a Mastodon status #MastodonAPI #coding https://shanedowling.com/kindle-scribe-to-mastodon.html

box464, (edited ) to random
@box464@mastodon.social avatar

I'm playing around with mastodon 4.2 advanced search, digging into the code a bit. Really trying to do some trickery here but the devs have it pretty well locked down to exactly what is documented. I thought I could inject some elasticsearch precedence or other patterns but those are purely ignored (or cause issues with the search)

Honestly not sure if I'm even using the right syntax but looks close.

https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-simple-query-string-query.html

#MastodonApi #MastoDev

liaizon, to random
@liaizon@wake.st avatar

Is there anyone working on generalizing the Mastodon API, or documentation to follow for apps that are using it for things other then Mastodon?

oli, to random German
@oli@social.tchncs.de avatar

Hey Mastodonians! I've been busy/bored so I wrote you a bash script to download all your Mastodon posts to perform funny queries and searches on them using DuckDB!

https://github.com/olithissen/masto.sh

box464, (edited ) to random
@box464@mastodon.social avatar

Learning that the Mastodon V2 Search API is pretty finicky. Advanced search criteria must be entered in a specific structure or the whole thing goes bonkers.

/api/v2/search?q=has:image -is:sensitive -is:reply dogs

That works, but note that the last item needs to be the search term.

EDIT: I think it's rate limiting while flipping options back and forth quickly causing the issue. Client side query caching to the rescue!

Also, some criteria work together, some don't.

mistersql, to mastodon
@mistersql@mastodon.social avatar

#mastodon #mastodonapi - Help me lazyweb, did someone already create a "mastodon API results to compact markdown" tool? e.g. for submitting to ChatGPT without wasting a retirement accounts worth of tokens?

andypiper, to random
@andypiper@macaw.social avatar

It's the little things, but I updated the branding colours on the #Mastodon docs site to match the actual branding of our other pages (we want to do a much broader refresh of that section of our site, too). A huge thank you to @vmstan in particular, as well as others on our triage squad, for helping to get a backlog of doc updates moving along, too. 🫶🏻 bit by bit, we're making it better! #MastodonAPI https://docs.joinmastodon.org/

TheQuinbox, to random

Am I missing something, or is the way you get what a particular instance calls toots completely and totally undocumented? #MastodonAPI

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • kavyap
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • ngwrru68w68
  • Youngstown
  • everett
  • slotface
  • rosin
  • ethstaker
  • Durango
  • GTA5RPClips
  • megavids
  • cubers
  • modclub
  • mdbf
  • khanakhh
  • vwfavf
  • osvaldo12
  • cisconetworking
  • tester
  • Leos
  • tacticalgear
  • anitta
  • normalnudes
  • JUstTest
  • All magazines