Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

activity streams markup I am going to be going off of #9

Open
maxwell opened this Issue · 14 comments

3 participants

@maxwell
Owner

Hi all,

Referencing this:http://activitystrea.ms/specs/json/1.0/,

I am going to be assuming this plugin in posting this markup to the correct route to Diaspora.

If we can make up this format, or close to it, I can progressively enhance the Diaspora side of things when we need to.

At first, I am only going to be worrying about activity.object.url, and activity.object.displayName, and work from there.

We can use the article, rather than the note, for this plugin.
http://activitystrea.ms/head/activity-schema.html#article

{activity: {
"published": "2011-02-10T15:04:55Z",
"actor": {
"url": "http://example.org/martin",
"objectType" : "person",
"id": "tag:example.org,2011:martin",
"image": {
"url": "http://example.org/martin/image",
"width": 250,
"height": 250
},
"displayName": "Martin Smith"
},
"verb": "post",
"object" : {
"url": "http://example.org/blog/2011/02/entry",
"id": "tag:example.org,2011:abc123/xyz" <== this is the permalink to the post, also
"content":"the html content of the post",
"type": 'article',
"displayName": "title with shortlink"

},
"target" : {
  "url": "http://example.org/blog/", <== root of the blog
  "objectType": "blog",
  "id": "tag:example.org,2011:abc123", < == also root of the blog
  "displayName": "Martin's Blog"
}

}
}

@untitaker

Once i am authenticated with OAuth, how can i write a simple status message; which URL shall i use and which GET/POST parameters shall i attach?

Or shall i use the notes thingy we already have...?

@maxwell
Owner

well it should be /activity_streams/note, and you should post it as json mime type, and close to the above structure you can make it.

@untitaker

/activity_streams/note returns an error 404 ("routing error") on my local pod and on joindiaspora.

Or is this the way Diaspora reports you a bad request?

@maxwell
Owner

Yup that is because this does not exsist yet, but you can still build the plugin against it.

@untitaker

Okay, well...

If i understand you right, i should pass the structure above "json_encode()"'d as a POST parameter, just like the notes thingy worked?

@untitaker
{"activity":{
    "object":{
        "content":"Test"
        "type":"article"
    }
}}

Would this be acceptable, since the pod is able to figure the other parameters out itself?

@maxwell
Owner

it should be a little more explicit, ie where it is coming from as it is easier for the sender to generate some of this information, rather than the pod inferring it from the state of things

@untitaker
@maxwell
Owner

publication date != created at date on the server. it is the date that the original blog post was written.

@untitaker

Okay, i am just going to insert the current time in that field. Because i also want to send messages that don't have got anything to do with blogposts.

@jbivins

The only thing that's missing in the plug-in is the shortened url that's a part of object->displayName. When the activity is converted into an activity stream, PHP escapes forward flashes and converts apostrophes to an HTML entity (a four character code). If that's problematic for you or if it isn't suppose to be that way, I can try to undo that side-effect.

@maxwell
Owner

I bet we can figure something out. I assume that is just base64 encoding the thing?

@jbivins

With the other types of Diaspora sharing mechanisms that link over to the Diaspora Bookmarklet, do you still want to try to continue this WordPress plug-in route of creating an activity stream from WordPress and sending that to Diaspora? People have recently inquired about this plug-in and they probably are not aware of the other sharing programs out there that people have created in early to mid-September.

@maxwell
Owner

Hey, thanks for sticking with me.

While we have been slow to support the activity streams branch, it will be the future of the Diaspora API, but we might have just started a bit too early.

Thanks for sticking with me...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.