From e5d8fd6857facd21c82c085fe51493333b8dc919 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 22 Jun 2011 17:09:04 -0400 Subject: [PATCH] Add Activity Streams feeds to export data --- actions/showstream.php | 11 ++++++++++- lib/feed.php | 7 +++++++ lib/feedlist.php | 3 +++ theme/base/css/display.css | 7 +++++++ theme/base/images/icons/activitystreams.png | Bin 0 -> 823 bytes 5 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 theme/base/images/icons/activitystreams.png 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 0000000000000000000000000000000000000000..dfb32693658616d99fc97cfa9073829923262617 GIT binary patch literal 823 zcmV-71IYY|P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipb~ z6$2yPxcG$t00Os3L_t(I%Y~CYZ<|#ZhOhHszm8ugcI=QuDQSf&Dk8ND48VfQ07Bj1 zA0Q#dEDZdJGVuqf#LR$@I=}6L!1U*eq1cZ zJ*%^p!Bh|PX7htetwuKuqUMih|i_g3ekW+NBFB>DW|~kol5l8&&q# zGptsO3eVrOf^jKSjAk=4EPX^0lrA<`E+{Kr2*yX}Jl8sP-n+WXdc{&mz#2_&UeZ5v ztXa)&y~5{zp7P^hLGV6`7pypk7)|oRS>d>IG~)NslDQMM^D3|IwRmwW$A!qf;ezAI zk`x5-9&rxqy+^DeMWH*Kb2K?)w~=8KeBU4Q!@~)A#Sl|s;R2C_)f(|0?>$z;BVut* zc%hT?{!5p*w6O-j+y(CT$NYRUWxJ8_@?MKCx&!X^$A}0b9xF}|>k;qSs#z@X>90Lb z76q^Dw|VVin>U`@0^np(vRIWw|73z-y?DeMObp!l;}Ku~H6X7Tw1RIRJf>c?TyE#A zeBgMxV(I1I3F5KNm54QXFYK+a@%FWSuI@BR3GO|f^4-yp;aSN>R^i5#U4H40=nm(I z_c&K#gPiNQ(y@PGljl1P?w^b)C2+a3&h^(12ob7AGg*~%2V=x}L_9$RyDCaDW0WEC zQ*S_bFk&!Y;X~w^Mva4=7VSKv@PP-XbB;y}v{JazsZ~*8uk7tnis#XA#7=XA*;#>B z3JZ*8E54a5NhB1UbE6qdXEgJi?Pd$xZg*rlIlVb8OYZlM(NDQ!1l4Ke)bsky)>cOp z!1a$lW42t{-yWV|o;>G25@O=u!Y<8LE?*tK!#~s6jBXV66j%TN002ovPDHLkV1lxz BeKi08 literal 0 HcmV?d00001 -- 2.39.5