activitystreams-unofficial: ActivityStreams for Facebook and Twitter

38 views
Skip to first unread message

Ryan B

unread,
Mar 13, 2012, 12:44:24 AM3/13/12
to activity...@googlegroups.com
hi all! i've just finished and posted a little side project:

https://github.com/snarfed/activitystreams-unofficial
http://snarfed.org/2012-03-12_activitystreams_for_facebook_and_twitter

From the blog post:

"I've just published activitystreams-unofficial, a stand-in
ActivityStreams server for major sites that don't implement it
themselves. It currently has implementations for Facebook and Twitter,
deployed at these endpoints:

http://facebook-activitystreams.appspot.com/
http://twitter-activitystreams.appspot.com/

This complements the unofficial WebFinger and PortableContacts
providers I published recently -
2012-01-16_webfinger_for_facebook_and_twitter,
2012-02-22_portablecontacts_for_facebook_and_twitter . I've updated
the WebFinger provider to include `Link` elements pointing to these
new ActivityStreams endpoints.

They're all just little side projects, and may not be hugely useful on
their own, but together they're another step toward implementing
OStatus bridge apps
(http://snarfed.org/2011-07-27_facebook_app_for_ostatus ) for more of
the major social networking sites.

Feedback and pull requests are welcome!"

as an example, martin atkin's activitystreams test client happily
consume output from both sites:

http://activitystreamstester.appspot.com/

--
http://snarfed.org/

Ryan B

unread,
Mar 13, 2012, 1:00:32 AM3/13/12
to activity...@googlegroups.com
as background, this implements the REST API defined by opensocial:

http://opensocial-resources.googlecode.com/svn/spec/2.0.1/Social-API-Server.xml#ActivityStreams-Service

the first release is read only. it supports getting the current user's
posts with /@me/@self and their friends' posts (ie the facebook "news
feed" or twitter "timeline") with /@me/@all or /@me/@friends. it also
supports getting a specific activity with /@me/@all/@app/ACTIVITY_ID.

the standard startIndex, count, and format (json, atom, xml) query
parameters are supported.

the schema mapping is pretty simple. it uses the "post" verb and
"note" object type for all posts and tweets. it includes actor and
generator fields and image attachments, but otherwise doesn't dive too
deep. i intentionally didn't try to come up with comprehensive schema
mappings.

depending on demand, future releases may add more object types, write
support, filtering, deeper schema mapping, and other features.


--
http://snarfed.org/

Michiel de Jong

unread,
Mar 13, 2012, 4:38:27 AM3/13/12
to activity...@googlegroups.com
That's really cool stuff! Do you think you could put CORS headers on this? CORS are http response headers that allow access from client-side web apps. For GET requests that are public on the web (so basically everything except intranet, resources inside a cookied session, etc.), you can specify 'Access-Control-Allow-Origin: *' as an added http response header, and make us at Unhosted very happy. :) Because it would mean we can write a web app that people can install into their browser, and it would be able to access your proxy directly from the user's browser.

If you don't put CORS headers on there, then our application needs to go through our server before it goes to your proxy. We would need to proxy your proxy, which is sort of a shame. :) It's much nicer if a web app can connect there directly using an AJAX request.

The webfinger spec now already discusses this, and is already doing it in all the examples:
https://tools.ietf.org/html/draft-jones-appsawg-webfinger-01

i don't know what the situation is for ActivityStreams and PoCo, but my intuition is that if we're in the business of breaking down walls, then same-origin barriers should also be torn down.

Cheers!
Michiel

--
You received this message because you are subscribed to the Google Groups "Activity Streams" group.
To post to this group, send email to activity...@googlegroups.com.
To unsubscribe from this group, send email to activity-strea...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/activity-streams?hl=en.


Ryan B

unread,
Mar 13, 2012, 2:43:55 PM3/13/12
to activity...@googlegroups.com
On Tue, Mar 13, 2012 at 1:38 AM, Michiel de Jong <mic...@unhosted.org> wrote:
> That's really cool stuff! Do you think you could put CORS headers on this?
> CORS are http response headers that allow access from client-side web apps.

thanks for the kind words! yup, the CORS header was on my todo list
for webfinger, and i should do it for poco and activitystreams too.
thanks for the nudge.

--
http://snarfed.org/

Ryan B

unread,
Mar 13, 2012, 9:21:22 PM3/13/12
to activity...@googlegroups.com
On Tue, Mar 13, 2012 at 11:43 AM, Ryan B <goo...@ryanb.org> wrote:
>
> thanks for the kind words! yup, the CORS header was on my todo list
> for webfinger, and i should do it for poco and activitystreams too.

done.

--
http://snarfed.org/

Reply all
Reply to author
Forward
0 new messages