@tokyo_0@mas.to
@tokyo_0@mas.to avatar

tokyo_0

@tokyo_0@mas.to

Please don't send me DMs
#noBridge

Recovering newsaholic
Focus: wellbeing, Hinduism, better social media, coding projects, climate, health, economics, security, Japan, India, Asia
Projects: #MastodonContentMover, #MastodonRetootBookmarklet
Boosts are not endorsement
Content warnings please
No justice, no peace
Born at 337ppm CO₂
日本語もOKです
Karishye vachanam tava 🙏

This profile is from a federated server and may be incomplete. Browse more on the original instance.

tokyo_0, to random
@tokyo_0@mas.to avatar

Love is... sitting down to code at 9pm on a Friday night when you're actually exhausted and really don't want to code anything right now. 🤪

tokyo_0,
@tokyo_0@mas.to avatar

Trying to wrap my head around creating a store of posts where each has a unique id that won't change when reposted to a new instance, because what I want is for people (including me) to be able to incrementally build their archive of posts even if they move several times, but still have their own threads preserved correctly.

Was going to do it based on post creation date, but that will fail if an instance #2 post replies to an instance #1 (reposted) post. 🤔

tokyo_0,
@tokyo_0@mas.to avatar

I think it's definitely possible... just a little bit more complicated than I had been thinking.

Maybe the dates are only going to be useful for structuring the data in the file system in a user-readable way. Starting to think I'm going to need multiple pointers to a reposted post - so perhaps each post remembers the different ids it has had, and each time it's reposted the new id is added. Then all the replies will point to the right thing.

tokyo_0,
@tokyo_0@mas.to avatar

Oh, this is going to be exciting.

To "boost" a status, all you need is the id of the status you are boosting.

But that id is instance-specific. So if you're boosting it again on a different instance, how are you supposed to find the toot to boost? Even if you use the information from the earlier instance to find it on its own instance, you'd then have to find it on your new instance.

Not sure this can actually be done right now. But it must be possible. 🤔

tokyo_0,
@tokyo_0@mas.to avatar

There is a way... mwahaha. I've missed this.... this... being able to do something. Being able to create something that didn't exist, from nothing but my own idea and some very rusty programming skills. This mental challenge. ☺️

(And the way is to search for the url of the status that is to be boosted - which is included in the data from the old instance - and perform that search on the new instance specifying "resolve=true", and that gives you the new id.)

tokyo_0,
@tokyo_0@mas.to avatar

Improved parameter handling for consistency and to parse parameters entered in any order, and to fail with a helpful message if they are specified incorrectly.

(Did some work on the classes that will store post data as well today - going to shift back to that for a bit now I know I'm not writing a bunch of parameter handling code that I'll have to write again to tidy up later.)

tokyo_0,
@tokyo_0@mas.to avatar

Oh my god... the API includes the full profile details of the posting user for every single one of the statuses they posted (when you've asked for their statuses) in, like, a page of 40 statuses.

But to get the raw text of the status without the HTML Mastodon has added to it, you have to do an individual API call for every single one.

Surely this can't be true 🤦‍♀️ It's late.... I must be missing something... 😂

tokyo_0,
@tokyo_0@mas.to avatar

Seriously, who did this? 😂😂😂

Just as well I wasn't planning on maxing out my API calls, huh.

tokyo_0,
@tokyo_0@mas.to avatar

And I can't even access it in the browser to test because it needs an App token... lordy 🙃

tokyo_0,
@tokyo_0@mas.to avatar

I only have 757 statuses 🤔😅

tokyo_0,
@tokyo_0@mas.to avatar

Amid the many hurdles I've overcome on this project so far, little did I think what would wrongfoot me would be date formats.

I should've known better.

In 20 years, all they've done is made the Java date libraries more confusing. Now I have an "UnsupportedTemporalTypeException" and a "TemporalAccessor" and a problem with my "ChronoField"... it's like something out of Dr. Who.

tokyo_0,
@tokyo_0@mas.to avatar

"As such, an Instant cannot be formatted as a date or time without providing some form of time-zone"

Yeah that needs to be in the summary at the top of the Javadocs for Instant, not buried in the definition of a constant field in DateTimeFormatter. 😒

tokyo_0,
@tokyo_0@mas.to avatar

The beginnings of some post data, saved as an xml file in the right place in the directory structure.

Each post will be saved in a folder, named according to the date and time when the post was first created. Most of the post data will be saved in an xml file of the same name within that folder, but there will also be a folder for media.

The idea is that you'd be able to manually inspect or edit your post data if you wanted after saving.

tokyo_0,
@tokyo_0@mas.to avatar

Been too exhausted the last few days to even look at this, but I really want to get something working this weekend and ideally in a state where other people could test it. A lot of functionality I'd like to include may have to be skipped for that, but given the need it would be better to get a test version out sooner rather than later.

I might go mad if I keep spending every spare and usable waking moment on it for much longer, too. 🤪

tokyo_0,
@tokyo_0@mas.to avatar

Slow start this morning as I was so exhausted (and the Kishida news didn't help) but am going to spend some time on this now. Let's see what can be done. ✊

A lot of the initial time-consuming figuring out of how things need to work and building various data structures is done, and authentication is done too (that was also quite time-consuming). Taking a pause this week wasn't a bad thing; I decided to adjust how encapsulation will work with some data classes.

tokyo_0,
@tokyo_0@mas.to avatar

I think saving the posts should be quite straightforward. Handling the threading may be tricky but I've already thought that through and, I hope, spotted a gotcha in my initial ideas and come up with an alternative.

Media might be a headache. Media on is uploaded (and, possibly, downloaded) separately from the rest of the post, and I don't know exactly how that's going to work yet.

tokyo_0,
@tokyo_0@mas.to avatar

I'd also like options for whether to overwrite or add to archives. Neither of those options will be trivial to implement so I might just throw an error for now if the archive already exists.

Still need to check if media uploads and reuploads are lossy but I think I've figured out a way to test that.

One thing I need off the bat is the ability to upload only posts for a certain date window. User tags and hashtags also need to be disabled.

tokyo_0,
@tokyo_0@mas.to avatar

Wondering what happens if you post to Mastodon and set the post sensitivity to "true" but set no content warning text... does it just not appear at all? 😅

tokyo_0,
@tokyo_0@mas.to avatar

That "Lord, I've been coding almost since I woke up and it's still not done yet" feeling 😞

It's probably my fault for testing. Everyone knows we should ship if it compiles. 😏

tokyo_0,
@tokyo_0@mas.to avatar

Ok.... it saves stuff. It saves everything other than custom emojis (later, sorry) and media.

Next — either saving media, or starting work on the bit that does the (re)posting.

I kind of want to get the media working because it's a big deal and most of The Point™, but I'm also anxious that I've done all this work and haven't really tested out any posting at all yet... so I'll probably do that instead.

But not right now. 🤪🤪🤪

tokyo_0,
@tokyo_0@mas.to avatar

(How have I spent so long on this today and got so little done?... 😭... that'll teach me for trying to do anything productive on a Saturday, otherwise known as "recovery day"... I love my job 😒)

tokyo_0,
@tokyo_0@mas.to avatar

Well I don't have the media saved yet, but I have the url of the media (and it works), the alt text for the media and the focal point coordinates for the media.

We're pretty close.... and I think for tonight that will have to do.

tokyo_0,
@tokyo_0@mas.to avatar

Let's save some media ✊

tokyo_0,
@tokyo_0@mas.to avatar

Totally failing at this today. Keep getting distracted. Don't have time to get distracted. orz

tokyo_0,
@tokyo_0@mas.to avatar

Yay, we're saving media 🙌

Not sure what Gargron's up to but the jpg I uploaded earlier was 178Kb, and the one I downloaded again was 267Kb 🤔😅

The video was a few Kb smaller. Will test for loss in a bit.

tokyo_0,
@tokyo_0@mas.to avatar

Let's find out how lossy jpegs and mp4s are when you repeatedly upload them to Mastodon and then download them again 👍

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