Monday, September 19, 2011

Trying to implement sharing posts - more fun reverse-engineering Google+

As promised in my previous post, I have just released G+7 version 1.5, which supports adding +1s to posts.

With this out of the way, I am starting to investigate how to implement sharing posts. Of course, this is not (yet) possible with the freshly released Google+ API, so as usual, I have to do some reverse-engineering and add a lot of guessing. I am close to understanding how everything works, with selecting circles to share with and all the gory details. There is just one tiny detail that I have no idea about. So, Googlers, hackers, Ajax people, maybe you van help me out.

Apparently, to share a post on Google+, I have to POST this sort of JSON message to it:

[
    "share with nobody",
    "oz:104167973823715920379.13280d46e2b.0",

    "z134ip5j0ovce3a4a04cgvszxu2qdjrgk24",
    null,
    null,
    null,
    [],
    null,
    {
        "aclEntries":
            [
                {
                    "scope":
                        {
                            "scopeType":"focusGroup",
                            "name":"empty",
                            "id":"104167973823715920379.4c320e48a4b5a4a",                         

                            "me":false,
                            "requiresKey":false,
                            "groupType":"p"
                        },
                    "role":20
                },
                {
                    "scope":
                        {
                            "scopeType":"focusGroup",
                            "name":"empty",
                            "id":"104167973823715920379.4c320e48a4b5a4a",
                            "me":false,
                            "requiresKey":false,
                            "groupType":"p"
                        },
                    "role":60
                }
            ]
    },
    true,
    [],
    false,
    false,
    null,
    [],
    false,
    false
]


Believe it or not, but I know what all the above long numbers are (104167973823715920379 is some sort of category marker or whatever that can be retrieved from another Ajax call, 4c320e48a4b5a4a is the circle ID and z134ip5j0ovce3a4a04cgvszxu2qdjrgk24 is the post ID). The only thing I have no idea about is the stuff in the red. It looks like some sort of a timestamp or something, but unlike regular Google+ timestamps (which are just new Date().getTime() Javascript fuction results), this one has some hex numbers in it (or so it seems).

So, if you are able to help me out here, just let me know.

Or, if you are a Googler working on the Google+ API, feel free to just implement this functionality in the next rev or G+ API. I would really be grateful if I could just dump this stupid reverse-engineering stuff and use a proper API.

UPDATE (12 Oct 2011):

the mysterious part kinda looks like timestamps (milliseconds since 00:00 01.01.1970)  in hex.

13280D46E2B is 1316421398059 in decimal, which is some time on Sept 19th 2011, which is when I conducted the experiments and when the post was made.

Will I be able to implement sharing soon? Find out tomorrow

No comments:

Post a Comment