XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

Experiment: Unified exhaustive `data-timeline-id` parsing

Open marcustyphoon opened this issue 1 year ago • 4 comments

Description

This is the most horrifying thing I have ever created using javascript. I wanted to give it a try, though, as I figured I could cherry-pick snippets/solutions/concepts from it for whatever we actually wind up implementing.

I did wind up kind of liking passing a filter function directly into filterPostElements. Pretty much all of the "generate multiple outputs from one set of source data that describes the timeline ids" code isn't worthwhile, though, or at least I couldn't figure out a form for it that's any good.

Testing steps

marcustyphoon avatar Jun 05 '24 12:06 marcustyphoon

Aw, man. Tagged pages break this paradigm, as you have to be able to treat data-timeline-id="hubsTimeline-some tag-recent-search_box_suggestion_followed_tag" and data-timeline-id="hubsTimeline-some tag-recent-undefined" the same way, which would have to become a [data-timeline-id^="etc"] CSS selector only in that specific case, which is hard to automate.

I mean, maybe you could ^= all of them, particularly with the fixes to patio timeline ids I'm waiting on? That would probably break in certain scenarios in the engineered cases like "my blog name is undefined-undefined" unless ids are tweaked further, but I mean, who really cares.

marcustyphoon avatar Jun 21 '24 15:06 marcustyphoon

collection:

regular, v1; patio, v1: data-timeline="/v2/timeline" data-which="pack" patio, v2: data-timeline-id="collection-[columnid]-[collectionid]"

drafts:

regular, v2: data-timeline-id="drafts-[blogname]"

marcustyphoon avatar Jun 26 '24 18:06 marcustyphoon

https://www.tumblr.com/timeline/trending_gifs: data-timeline="/v2/timeline" data-which="trending_gifs" https://www.tumblr.com/timeline/trending_video: data-timeline="/v2/timeline" data-which="trending_video" https://www.tumblr.com/timeline/trending_photos: data-timeline="/v2/timeline" data-which="trending_photos" https://www.tumblr.com/timeline/trending_text: data-timeline="/v2/timeline" data-which="trending_text" https://www.tumblr.com/timeline/trending_asks: data-timeline="/v2/timeline" data-which="trending_asks"

https://www.tumblr.com/tagged/gif?sort=community: data-timeline-id="searchCommunities-gif-undefined-undefined}" https://www.tumblr.com/search/gif?v=community: data-timeline-id="searchCommunities-gif-undefined-undefined}" (yes, that is a curly brace, presumably a typo)

https://www.tumblr.com/blog/[blogname]/blaze/campaigns: data-timeline="/v2/ignite/posts/all"

https://www.tumblr.com/communities/browse/anime: data-timeline-id="communities-browse-category-anime"

https://www.tumblr.com/search/gif?v=blog: data-timeline-id="searchTimeline-blog-gif-top-0-undefined-undefined-undefined" https://www.tumblr.com/search/gif?v=tag: data-timeline-id="searchTimeline-tag-gif-top-0-undefined-undefined-undefined"

marcustyphoon avatar Feb 19 '25 13:02 marcustyphoon

I was keeping this around as a reference for timeline id data I collected, but it doesn't need to be a PR.

marcustyphoon avatar Jun 19 '25 07:06 marcustyphoon