Contact Add Cookies

0 views
Skip to first unread message

Stephen Paul Weber

unread,
Aug 14, 2008, 12:50:41 PM8/14/08
to DiSo Project
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This subject has come up on this list before, but it is of interest to
me again today, so I'll recap where we are and such.

We need (want) a nice page-integrated way to do adding contacts
distributedly. Bookmarklets and greasemonkey scripts work well (for me)
but confuse the heck out of users, or they just forget about them.

It was suggested on the list that a cookie holding the template for a
person's personal 'contact add' page could be set at a known domain.
Then a javascript widget at that domain can be called, passing in the fn
and url of the profile being looked at. The widget then renders an 'add
me' button with the URL correctly pointing to the user's add a contact
page page 'home'.

This may not be a perfect solution long term, but it works *very* nicely
in practise.

I have the following PHP sitting at
http://singpolyma.net/diso-cookies.php

<?php

header('Content-Type: text/javascript');
if($_GET['source'] == 'wordpress' && $_SERVER['HTTP_REFERER']) {
$url = explode('wp-admin',$_SERVER['HTTP_REFERER']);
setcookie('diso-contact-add',
$url[0].'wp-admin/link-add.php?name={fn}&linkurl={url}',
time()+60*60*24*7*30*12, '/');
}//end if source wordpress && $_SERVER['HTTP_REFERER']

?>

Simple, unobtrusive. The current developement version of diso-profile
adds an invisible call to the header of the wordpress dashboard pages
that hits this script. No data is sent at all, the page is just hit
(hence why I use referer), although disclosure of some kind that this
happens would be good so the first person to 'find out' doesn't scream.

I then have this script at diso-contact-add.php

<?php

header('Content-Type: text/javascript');

$template = $_COOKIE['diso-contact-add'];
if($_GET['template']) $template = $_GET['template'];

if($template) {
$template = str_replace('{fn}', urlencode($_GET['fn']), $template);
$template = str_replace('{url}', urlencode($_GET['url']), $template);
$show = true;
} else $template = $_GET['url'];

$html = '<a target="_blank" title="'.htmlspecialchars($_GET['fn']).'"
href="'.htmlspecialchars($template).'" rel="action"
class="diso-contact-add"';
if(!$show) $html .= ' style="display:none;"';
$html .= '>';
if($_GET['image'])
$html .= '<img src="'.htmlspecialchars($_GET['image']).'"
alt="'.htmlspecialchars($_GET['label']).'" />';
else
$html .= htmlspecialchars($_GET['label']);
$html .= '</a>';

echo 'document.writeln("'.addslashes($html).'");';

?>

I am calling it from the development version of diso-profile and also my
search engine <http://scrape.singpolyma.net/profile/> on profile pages.
It works quite nicely. I get a small button of the sort I would expect
from a social networking profile that lets me add a contact on my
wordpress blog to my blogroll, whch then works well with the other DiSo
functionalities I have set up for contacts.

Item #1 : if we deploy this it should probably not live at
singpolyma.net
Item #2 : what (if any) disclosure should happen if we deploy this in
diso-profile?

I'd really like to do some cleanup (of this and some other stuff) in
diso-profile and release a version that has this feature.

- --
Stephen Paul Weber, @singpolyma
Please see <http://singpolyma.net> for how I prefer to be contacted.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIpGJw6oSxepE9BOsRAqD2AJ0a4hcPTiTcsOMXTYaE3HLRzqtZcQCg3to1
iWkBvdPQ4ldjspopWY6caVM=
=kk2t
-----END PGP SIGNATURE-----

Steve Ivy

unread,
Aug 14, 2008, 1:03:14 PM8/14/08
to diso-p...@googlegroups.com
I like the general idea. If you want, we can host it at distributedsocial.net.

--
Steve Ivy
http://redmonk.net // http://diso-project.org
This email is: [ ] bloggable [x] ask first [ ] private

Chris Messina

unread,
Aug 14, 2008, 3:30:57 PM8/14/08
to diso-p...@googlegroups.com
I'd like to see this in action first... and I'd like to know who (viewer or site owner) gets to see the "add friend" functionality -- not to mention what it means...! Are we only talking about adding URLs to the blogroll? If so, that seems like very shallow value, non?

If, OTOH, adding a friend provides additional value, like the ability to send messages and/or share data, that's interesting... furthermore, "Follow" might be more appropriate -- but then, only if we add recent posts from the "followee's" ATOM feed to the WordPress Dashboard.

I guess before we go about implementing this functionality -- which sounds like an approach that might work -- I'd like to know what end-user value we're driving and for whom. Simply adding friends to a blogroll seems limited in real utility... in which case, aren't we just duplicating but decentralizing MyBlogLog without the cross-network tracking benefits?

Chris
--
Chris Messina
Citizen-Participant &
Open Source Advocate-at-Large
factoryjoe.com # diso-project.org
citizenagency.com # vidoop.com
This email is: [ ] bloggable [X] ask first [ ] private

Stephen Paul Weber

unread,
Aug 14, 2008, 3:41:55 PM8/14/08
to diso-p...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Aug 14, 2008 at 03:30:57PM -0400, Chris Messina wrote:
> I'd like to see this in action first...

Install the plugin and then visit my site/my search engine ;)

> and I'd like to know who (viewer or
> site owner) gets to see the "add friend" functionality

In practise, both, but it's meant for the viewer

> -- not to mention
> what it means...!

For the record, the word 'friend' never appears in any existing
implementation. The button on my page says "add me".

> Are we only talking about adding URLs to the blogroll? If
> so, that seems like very shallow value, non?

Currently, basically, yes. I mean, with my site by being added to my
blogroll there's all the permissions stuff that comes into play, for
both my profile and my actionstream.

> If, OTOH, adding a friend provides additional value, like the ability to
> send messages and/or share data

Sending messages is a bit out of scope. Sharing data is, ultimately,
the point. Actionstream could pull in stuff from their sites, there's
the permissions stuff on what is already on my site, etc. The value
comes from what other plugins do with your blogroll, though, not in
anything done "right here".

Do you have concepts (abstract or codable) that you think would make
sense at this level? It seems like friending/following/adding as a
contact is a key activity. What it means is something I'm personally
less concerned with, but I'm interested to hear thoughts.

> I guess before we go about implementing this functionality -- which sounds
> like an approach that might work -- I'd like to know what end-user value
> we're driving and for whom. Simply adding friends to a blogroll seems
> limited in real utility... in which case, aren't we just duplicating but
> decentralizing MyBlogLog without the cross-network tracking benefits?

Hmm... this is me throwing something against the wall to see what
sticks. The quasi-centralized nature came out of a (can't find just
now) previous discussion about how the heck this could work without
someone synching it all up. Browser cookies seemed like a good interim
solution. No data is stored server-side.


- --
Stephen Paul Weber, @singpolyma
Please see <http://singpolyma.net> for how I prefer to be contacted.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIpIqD6oSxepE9BOsRApL2AJwIo8jCI+Qi2oLbBtJxdFmM5E+A9ACg0XLG
WL7g5OXzF8kcNpi45kRf2M8=
=KzNm
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages