From: Evan Prodromou Date: Wed, 22 Jun 2011 21:09:04 +0000 (-0400) Subject: Add Activity Streams feeds to export data X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e5d8fd6857facd21c82c085fe51493333b8dc919;p=quix0rs-gnu-social.git Add Activity Streams feeds to export data --- diff --git a/actions/showstream.php b/actions/showstream.php index fe819d30cf..b4b7faf80a 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -127,7 +127,16 @@ class ShowstreamAction extends ProfileAction $this->user->nickname, $this->tag))); } - return array(new Feed(Feed::RSS1, + return array(new Feed(Feed::JSON, + common_local_url('ApiTimelineUser', + array( + 'id' => $this->user->id, + 'format' => 'as')), + // TRANS: Title for link to notice feed. + // TRANS: %s is a user nickname. + sprintf(_('Notice feed for %s (Activity Streams JSON)'), + $this->user->nickname)), + new Feed(Feed::RSS1, common_local_url('userrss', array('nickname' => $this->user->nickname)), // TRANS: Title for link to notice feed. diff --git a/lib/feed.php b/lib/feed.php index e5a97a0cb8..7632aea09c 100644 --- a/lib/feed.php +++ b/lib/feed.php @@ -49,6 +49,7 @@ class Feed const RSS2 = 2; const ATOM = 3; const FOAF = 4; + const JSON = 5; // Activity Streams var $type = null; var $url = null; @@ -72,6 +73,8 @@ class Feed return 'application/atom+xml'; case Feed::FOAF: return 'application/rdf+xml'; + case Feed::JSON: + return 'application/json'; default: return null; } @@ -92,6 +95,9 @@ class Feed case Feed::FOAF: // TRANS: Feed type name. FOAF stands for Friend of a Friend. return _('FOAF'); + case Feed::JSON: + // TRANS: Feed type name. See http://activitystrea.ms/ + return _('Activity Streams'); default: return null; } @@ -103,6 +109,7 @@ class Feed case Feed::RSS1: case Feed::RSS2: case Feed::ATOM: + case Feed::JSON: return 'alternate'; case Feed::FOAF: return 'meta'; diff --git a/lib/feedlist.php b/lib/feedlist.php index bbe66b2e74..c57f377238 100644 --- a/lib/feedlist.php +++ b/lib/feedlist.php @@ -93,6 +93,9 @@ class FeedList extends Widget case Feed::FOAF: $classname = 'foaf'; break; + case Feed::JSON: + $classname = 'json'; + break; } $this->out->elementStart('li'); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 40656b7cf9..c9655d52c0 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -2009,6 +2009,13 @@ background-position:0 -64px; #export_data li a.foaf { background-position:0 1px; } + +#export_data li a.json { +background-image:url(../images/icons/activitystreams.png); +background-repeat:no-repeat; +background-color:transparent; +} + .form_group_leave input.submit, .form_user_unsubscribe input.submit, .form_user_remove_peopletag input.submit, diff --git a/theme/base/images/icons/activitystreams.png b/theme/base/images/icons/activitystreams.png new file mode 100644 index 0000000000..dfb3269365 Binary files /dev/null and b/theme/base/images/icons/activitystreams.png differ