kheina-com / Blue-Blocker

Blocks all Twitter Blue verified users on twitter.com
Mozilla Public License 2.0
322 stars 29 forks source link

Twitter communities parse failures! #245

Open rougetimelord opened 3 months ago

rougetimelord commented 3 months ago

The extension trips over the new communities objects. A redacted sample object looks like:

{
    "itemType": "TimelineCommunity",
    "__typename": "TimelineCommunity",
    "community_results": {
        "result": {
            "__typename": "Community",
            "id_str": "{stringified number}",
            "name": "{string}",
            "description": "{string}",
            "created_at": 1673718360780,
            "question": "{string}",
            "search_tags": [
                "{strings}"
            ],
            "is_nsfw": false,
            ...
            "admin_results": {
                "result": {
                    "__typename": "User",
                    "id": "{string}",
                    "rest_id": "{stringified number}",
                    "affiliates_highlighted_label": {},
                    "has_graduated_access": true,
                    "is_blue_verified": false,
                    "profile_image_shape": "Circle",
                    ...
                    },
                    "professional": {
                        "rest_id": "{stringified number}",
                        "professional_type": "Creator",
                        "category": []
                    }
                }
            },
            "creator_results": {
                "result": {
                    "__typename": "User",
                    "id": "{string}",
                    "rest_id": "{stringified number}",
                    "affiliates_highlighted_label": {},
                    "has_graduated_access": true,
                    "is_blue_verified": false,
                    "profile_image_shape": "Circle",
                    ...
                    },
                    "professional": {
                        "rest_id": "{stringified number}",
                        "professional_type": "Creator",
                        "category": []
                    }
                }
            },
            ...
            "members_facepile_results": [
                {
                    "result": {
                        "__typename": "User",
                        "id": "{string}",
                        "rest_id": "{stringified number}",
                        "affiliates_highlighted_label": {},
                        "has_graduated_access": true,
                        "is_blue_verified": false,
                        "profile_image_shape": "Circle",
                        ...
                        },
                        "professional": {
                            "rest_id": "{stringified number}",
                            "professional_type": "Creator",
                            "category": []
                        }
                },
                ...
            ],
            ...
}

We're hitting the errors at https://github.com/kheina-com/Blue-Blocker/blob/8aff16c54eef03d1f762fa7833bec3e96deaf403/src/parsers/instructions.ts#L44-L47 and https://github.com/kheina-com/Blue-Blocker/blob/8aff16c54eef03d1f762fa7833bec3e96deaf403/src/parsers/instructions.ts#L125-L132

I think we just have to add a new object traversal path and we'll be set. In better news it seems like this would be a good way to get 3 or 4 user objects to run at one time.

cooljeanius commented 3 months ago

I think we just have to add a new object traversal path and we'll be set.

So is this something you're going to try?

rougetimelord commented 3 months ago

I think we just have to add a new object traversal path and we'll be set.

So is this something you're going to try?

I'm down to give it a shot, but I'm going to be busy for the next week-ish if anyone wants to beat me to it :)