WP-OpenID and profile data

1 view
Skip to first unread message

Stephen Paul Weber

unread,
Dec 20, 2007, 11:39:50 AM12/20/07
to diso-p...@googlegroups.com
I think in could be really useful if the wp-openid plugin allowed for
all SREG data there is and stored whatever data it got in the user's
profile (not just name, nickname, and email). Any data that has no
standard wordpress meta key name could use the hCard class name (ie,
tz)

Parsing any hCard found on the identity page and storing that too
would be extra cool.

Rel=me might be a bit far-fetched for a login plugin, but maybe?

I realise those last two are really nothing to do with OpenID and
probably should be abstracted into another plugin that... wait! Yes,
thinking out loud here. Plugin that hooks into the create new user
action and parses any hCard/rel=me on that page and stores it with the
new user...

--
- Stephen Paul Weber, Amateur Writer
<http://www.awriterz.org>

MSN/GTalk/Jabber: singp...@gmail.com
ICQ/AIM: 103332966
BLOG: http://singpolyma.net/

Steve Ivy

unread,
Dec 20, 2007, 12:05:46 PM12/20/07
to diso-p...@googlegroups.com
Stephen,

This is exactly the point of the wp-profile plugin (mythical so far).
Feel free to start hacking. :-)

If you (or anyone) have code you actually want to donate/submit to go
in the repo, let Chris and I know and we'll get it hooked up.

--Steve

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

Steve Ivy

unread,
Dec 20, 2007, 12:15:32 PM12/20/07
to diso-p...@googlegroups.com

James D Kirk

unread,
Dec 20, 2007, 12:27:21 PM12/20/07
to DiSo Project
Yeah, I'd have to agree that the fewer plugins the better overall. If
it makes sense to add the functionality you are brainstorming out
loud :) Stephen, to the WP-openid plugin, then I'd vote for that
course of action, vs. creating multiple smaller plugins. I already am
addicted to plugin installations and activations (no doubt to the
detriment of the performance of my blog, and I bet others are too!),
so the fewer the better!

James.

Stephen Paul Weber

unread,
Dec 20, 2007, 2:23:31 PM12/20/07
to diso-p...@googlegroups.com
Well, the SREG stuff makes sense to go in WP-OpenID (that's the only
context SREG works in), but hCards kinda don't...

So I hacked together a basic implementation of what I meant:
<http://singpolyma.net/hcard-import.tar.gz>

It's basically invisible. When a new user is added (by any means) it
checks if there is a URL. (always will be with OpenID ;) ) If there
is, it fetches that page and looks for an hCard. If it finds more
than one it uses tho following rules to pick one (in order of
decreasing priority):

1) If there is an hCard in an <address> element, pick that one
2) If there is an hCard where uid == the page we're fetching, pick that one
3) If there is an hCard where url == the page we're fetching, pick that one
4) Pick the first hCard on the page

Once an hCard has been selected, it copies first name, last name,
email, fn to display name and nickname (assuming these values have not
already been set by the user -- it will no overwrite) all other
properties are imported into meta values that match their hCard class
name.

As an added bonus for me, I added a quick thing to the (as yet
unreleased) avatars plugin I use so that it now looks for a 'photo'
meta key -- meaning those signing in with OpenID who have hCards on
their URIs will get their comment avatar properly set ;)

--

Steve Ivy

unread,
Dec 20, 2007, 4:31:16 PM12/20/07
to diso-p...@googlegroups.com
Stephen,

You are totally rocking it!

Can i suggest you do some thinking about how your work can be morphed
into a new wp-profile plugin?

Things we've been discussing:

[x] hcard import
[ ] hcard *subscribing* - update automatically OR via user initiated
[ ] user hcard pages (documented on the wordpress site)
[ ] extended hCard profile fields for users
[ ] multiple url (rel-me) fields in profile

What do you think?

--Steve

Stephen Paul Weber

unread,
Dec 20, 2007, 5:10:46 PM12/20/07
to diso-p...@googlegroups.com
[x] hcard import

Done, although it may need some evolution to 'fit' better

[ ] hcard *subscribing* - update automatically OR via user initiated

Automatically on what event/how often? Overwrite existing values when
we do or no?

[ ] user hcard pages (documented on the wordpress site)

Like, user profile pages that have hCards?

[ ] extended hCard profile fields for users

Yes, I was looking at this today, shouldn't be too hard :)

[ ] multiple url (rel-me) fields in profile

Like, a textarea instead of line edit for URL and then split by
newlines type deal?

Steve Ivy

unread,
Dec 20, 2007, 5:31:22 PM12/20/07
to diso-p...@googlegroups.com
Hi Stephen,

On Dec 20, 2007 3:10 PM, Stephen Paul Weber <singp...@gmail.com> wrote:
>
> [x] hcard import
>
> Done, although it may need some evolution to 'fit' better
>
> [ ] hcard *subscribing* - update automatically OR via user initiated
>
> Automatically on what event/how often? Overwrite existing values when
> we do or no?

TBD. :-)

> [ ] user hcard pages (documented on the wordpress site)
>
> Like, user profile pages that have hCards?

Yes.

> [ ] extended hCard profile fields for users
>
> Yes, I was looking at this today, shouldn't be too hard :)
>
> [ ] multiple url (rel-me) fields in profile
>
> Like, a textarea instead of line edit for URL and then split by
> newlines type deal?

I was thinking n number of text fields, but I like your version better.

Stephen Paul Weber

unread,
Dec 21, 2007, 11:16:52 AM12/21/07
to diso-p...@googlegroups.com
<http://singpolyma.net/hcard-import.tar.gz>

All the extended profile options now show up on the profile editing
page and all data is stored properly (it's compatible with itself --
imported data makes it to the form, etc).

The first URL for the extended URLs list gets put in the main URL field.

Next:

* Maybe put a button on the profile page that will force import of
hCard from their primary URL/all their URLs? Two buttons -- one to
override data with the hCard and one to only fill in blank fields
* Privacy settings for each field -- to be complemented by
diso-contactlist / other privacy whatever happens?
* Profile pages? With template hacks the author could be done (ie
<http://singpolyma.net/author/singpolyma>), but it seems to give 404
on users that don't have post privileges... I'm debating what for
this should take. Any/all of the following:

display_hcard_for(USERID); //put in author.php as
display_hcard_for(intval($author))

<!--hcard(USERID)-->

Actually generate a /blah page for each user.

user_name();
user_email();
user_photo();
de hCard markup yourself -- best for if you want your own formatting,
but if you want that
$u = get_userdata();
$u->photo

works just as well.

--

Pfefferle

unread,
Dec 22, 2007, 7:28:10 AM12/22/07
to DiSo Project
I have made a similar wordpress plugin to use an hCard profile to fill
out the comment form, similar to the OpenID comments implementation,
if you are interested, you can take a look here:
http://wordpress.org/extend/plugins/hcard-commenting/ and a demo in
the comments of my blog: http://notizblog.org.

Perhaps we could use this code to also signup/import a new user...
> On Dec 20, 2007 5:31 PM, Steve Ivy <steve...@gmail.com> wrote:
>
>
>
>
>
> > Hi Stephen,
>
> > On Dec 20, 2007 3:10 PM, Stephen Paul Weber <singpol...@gmail.com> wrote:
>
> > > [x] hcard import
>
> > > Done, although it may need some evolution to 'fit' better
>
> > > [ ] hcard *subscribing* - update automatically OR via user initiated
>
> > > Automatically on what event/how often? Overwrite existing values when
> > > we do or no?
>
> > TBD. :-)
>
> > > [ ] user hcard pages (documented on the wordpress site)
>
> > > Like, user profile pages that have hCards?
>
> > Yes.
>
> > > [ ] extended hCard profile fields for users
>
> > > Yes, I was looking at this today, shouldn't be too hard :)
>
> > > [ ] multiple url (rel-me) fields in profile
>
> > > Like, a textarea instead of line edit for URL and then split by
> > > newlines type deal?
>
> > I was thinking n number of text fields, but I like your version better.
>
> > --Steve
>
> > --
> > Steve Ivy
> >http://redmonk.net//http://diso-project.org
> > This email is: [ ] bloggable [x] ask first [ ] private
>
> --
> - Stephen Paul Weber, Amateur Writer
> <http://www.awriterz.org>
>
> MSN/GTalk/Jabber: singpol...@gmail.com

James D Kirk

unread,
Dec 22, 2007, 6:27:32 PM12/22/07
to DiSo Project
Tag Matthias!

I've tried to leave a comment on your site (specifically, the APML
plugin at: http://notizblog.org/2007/12/21/new-apml-for-wordpress-version/)
in order to check out your hCard functionality.

The first time I posted my comment text I simply entered my OpenID URL
which is where I have my hCard located. After about 30 seconds or so,
I received the following 500 error:

<code>Error 500 - Internal server error

Ein interner Fehler ist aufgetreten!
Bitte versuchen Sie es zu einem späteren Zeitpunkt.</code>

So, I went back and this time entered my name and email address along
with my URL, but still got the error.

Clearly, there is a challenge with your site and the entire comment
submission process. Would have loved to see the hCard in action, but
now am wary about installing and testing it on my sites! Please let us
know when we might be able to see it working the way you envision it.

Thanks,

James.

Pfefferle

unread,
Dec 22, 2007, 7:45:11 PM12/22/07
to DiSo Project
Hello James,

I have tried the code, and everything works fine for me. there might
be only one little problem, i use hkit to parse the microformats, that
means you have to use some tidy-tools like that from the w3c (http://
cgi.w3.org/cgi-bin/tidy) and if the service is down, you get the
errors. If someone has an idea how to solve this, or if someone know
any other microformats php-parser?

What you have to do, to use the plugin, is to fill out the url field
with an hcard link and press hcard-enabled...

Matthias

Chris Messina

unread,
Dec 22, 2007, 8:02:16 PM12/22/07
to diso-p...@googlegroups.com
HKit also requires PHP5, so keep that in mind if you're trying to run
the plugin yourself. There's a handy WP plugin called diagnosis that
can help you determine what version you're running.

Chris

Sent from my iPhone

James D Kirk

unread,
Dec 22, 2007, 10:29:12 PM12/22/07
to DiSo Project
Yeah, I usually like to see the plugin working "somewhere" before I
install it on one of my sites, unless it's a dev site for
troubleshooting purposes. The PHP 5 wouldn't be a challenge, however
getting the correct functionality with Matthias' seems to be.

Here's the comment I tried repeatedly to get submitted to Pfefferle's
site:
~~~~~~~~~~~~~~~~~~
"Okay, it seemed that your hCard plugin worked when I did as you
recommended; namely entering the URL where my hCard was located. That
did fill in the forms. Not sure why the "Website" field was filled out
"http://Array" (no quotes, however.)

The original comment was not posted, however when the browser
refreshed I was "Welcomed back" and apparently logged in to your site
(via OpenID I presume?)

All in all seems a bit clunky, but I do like the working concept of
the hCard filling in stuff from a central source that I control."
~~~~~~~~~~~~~~~~~~

So the hCard "seemed" to pull the correct info for "Name and email
address" right from my hCard (this is located at http://jamesdkirk.com
if anyone wants to see it in action; you can do a source code search
on that page for "vcard" to see the exact code behind the hCard),
however for the Website field in the comment form, it simply displayed
"http://Array".

No clue what might have caused that one! Any clues, Matthias? Thanks.


James D. Kirk
http://Boldlygoing.com

gTalk: ja...@boldlygoing.com

Pfefferle

unread,
Dec 23, 2007, 6:56:39 AM12/23/07
to DiSo Project
@Chris: I use hKit only if the php version is 5.x, if its lower, I use
the service of microformatic (http://microformatic.com/help/xhtml/
hkit/)
that solves the problem for the time being.

@James: Yes, I got your Comment, it was only hold to approve. You are
right, if forgot to check if there is more than one website... thanks
for testing.

On Dec 23, 4:29 am, James D Kirk <jamesdk...@gmail.com> wrote:
> Yeah, I usually like to see the plugin working "somewhere" before I
> install it on one of my sites, unless it's a dev site for
> troubleshooting purposes. The PHP 5 wouldn't be a challenge, however
> getting the correct functionality with Matthias' seems to be.
>
> Here's the comment I tried repeatedly to get submitted to Pfefferle's
> site:
> ~~~~~~~~~~~~~~~~~~
> "Okay, it seemed that your hCard plugin worked when I did as you
> recommended; namely entering the URL where my hCard was located. That
> did fill in the forms. Not sure why the "Website" field was filled out
> "http://Array" (no quotes, however.)
>
> The original comment was not posted, however when the browser
> refreshed I was "Welcomed back" and apparently logged in to your site
> (via OpenID I presume?)
>
> All in all seems a bit clunky, but I do like the working concept of
> the hCard filling in stuff from a central source that I control."
> ~~~~~~~~~~~~~~~~~~
>
> So the hCard "seemed" to pull the correct info for "Name and email
> address" right from my hCard (this is located athttp://jamesdkirk.com

James D Kirk

unread,
Dec 23, 2007, 1:25:07 PM12/23/07
to DiSo Project
Just to clarify (and again, you can see the code of my hCard at
http://jamesdkirk.com, mid way down that page) I only have one URL
that is marked up for the hCard, the others are for my personal tags
or the links for the instant messaging services.

Hope that helps. Please drop us a line when you have an update, as I'd
like to get it installed and tested on one of my dev sites.

Thanks again.

James.

Pfefferle

unread,
Dec 23, 2007, 3:31:11 PM12/23/07
to DiSo Project
@James: the problem is, that all your instant messaging accounts are
also marked up as an url:

object url {
0=http://...
1=aim:goim?screenname=...
2=ymsgr:sendIM?...
}

So, I have to check which of them starts with "http://".

I think I also have to rename "hCard Enabled" to "get hCard" or
"import hCard", to make it clear that you have to klick the link to
get the hCard.

On Dec 23, 6:25 pm, James D Kirk <jamesdk...@gmail.com> wrote:
> Just to clarify (and again, you can see the code of my hCard athttp://jamesdkirk.com, mid way down that page) I only have one URL

Pfefferle

unread,
Dec 23, 2007, 3:55:04 PM12/23/07
to DiSo Project
there is a problem with hKit, every url of your site is detected as:

[url] => Array
(
[0] => http://jamesdkirk.com
[1] => http://jamesdkirk.com/aim:goim?screenname=...
[2] => http://jamesdkirk.com/ymsgr:sendIM?...
)

so I can't check if it begins with http(s)... Any suggestions?

James D Kirk

unread,
Dec 23, 2007, 4:34:29 PM12/23/07
to DiSo Project
Interesting. The IM links are what was output from the hCard creator,
so I'll have to get more familiar with the markup to see whether that
'class="url"' needs to be there for the IM's. For now, I've removed
those classes and I'll hit your comment form again to see if your
plugin still pulls an array.

And I agree with your concept of renaming the actual link. I'm the
kind of guy that would just mark it up once I installed it!

James.

Pfefferle

unread,
Dec 23, 2007, 4:45:50 PM12/23/07
to DiSo Project
I also changed the code a bit. If there is an array of email-adresses
or urls, the plugin uses only the first. so if you want to look at the
code you can use this trunk version: http://svn.wp-plugins.org/hcard-commenting/trunk/

James D Kirk

unread,
Dec 23, 2007, 4:51:29 PM12/23/07
to DiSo Project
Okay Matthias I went into my hCard code, and removed those classes
from the IM links (I guess they are links!)
Next, I went to your site, and cleared out my comment info and entered
just my hCard link (jamesdkirk.com) hit "import hCard" and nothing
happened! I realized that your plugin requires my hCard URL to have
the "http://".

And I've noticed that other OpenID Relying Parties forms sometime
require this, so if there's not something you can append inside the
code, I'd humbly suggest that you pre-populate the text input form
with the "http://" for the visitor to know that it has to be there.

Now, I have another question for you. Clearly your site is OpenID
enabled. How do the two plugins work in conjunction with each other
during the comment submission process? Is it that I just happen to
have my hCard at the same URL as my OpenID and that most people may
not do this? So, by putting my OpenID URL in there I am only going to
get your hCard import functionality IF I click on that import link? If
I don't click that link, but do enter my other information with my
OpenID URL, do I still go into your moderation queue? (Most likely
this is yes, as I don't think the OpenID comments do anything to
override moderation.

Finally, how hard would it be to integrate your Import functionality
right into the submit comment button? If I only had to enter my hCard
URL, write my comment, and then click submit and your plugin would
automatically enter the info from my hCard? Now THAT would be very
cool! Of course, the functionality would need to be expressed there on
the comment form, but that's just coding it all up with the proper
text display.

James.

Chris Messina

unread,
Dec 23, 2007, 4:57:58 PM12/23/07
to diso-p...@googlegroups.com
Just a quick clarification: IM addresses are indeed links and should
be marked up with class=url.

It's up to the parser to make sense of the links, and in this case the
plugin should only look at the urls that begin with http.

James, you should replace the markup you took out since it was correct
before. ;)

Chris

Sent from my iPhone

James D Kirk

unread,
Dec 23, 2007, 5:11:18 PM12/23/07
to DiSo Project
Okay DAD! I put the [class="url"] back in there :(

J/K!

And it looks like the changes you made, Matthias are working because
after reinserting the class to those two IM links, I hit your comment
form again, cleared out my information, and re-imported my hCard.
Filled it out quite nicely.

(off topic: every time I go back to that page, it displays "Your
comment is awaiting moderation." between the two comments that are
indeed posted on your page. Not sure that I posted another, but
perhaps I did? Thought you'd like to know in case that's something of
a challenge.)

Trusting that others are following and working along with this and
other threads. Hopefully, these activities are helpful?!

James.

Pfefferle

unread,
Dec 23, 2007, 5:19:46 PM12/23/07
to DiSo Project
@Chris: I agree with you, but as I mentioned, there is a problem with
hKit, every url of your site is detected as:

[url] => Array
(
[0] => http://jamesdkirk.com
[1] => http://jamesdkirk.com/aim:goim?screenname=...
[2] => http://jamesdkirk.com/ymsgr:sendIM?...
)

so I can't check if it begins with http(s)... Any suggestions?

@James: The OpenID plugin (I use the DiSo OpenID plugin from Will
Norris) has nothing to do with my plugin and both plugins work by
oneself.

I decided to use ajax instead of implementing it to the submit comment
button, because of different things:

* You can change the retrieved data after importing
* You can decide to choose the hCard or not

and there is also one worst case: If someone wants to post a comment
and wants to fill out the form hisself. He uses a url to a weblog
where he posted an hcard (not his profile). if he submits the comment,
the plugin detects the hcard and replaces his data with the hcard he
has posted on his weblog.

matthias

On 23 Dez., 21:57, Chris Messina <chris.mess...@gmail.com> wrote:
> Just a quick clarification: IM addresses are indeed links and should
> be marked up with class=url.
>
> It's up to the parser to make sense of the links, and in this case the
> plugin should only look at the urls that begin with http.
>
> James, you should replace the markup you took out since it was correct
> before. ;)
>
> Chris
>
> Sent from my iPhone
>

Stephen Paul Weber

unread,
Dec 23, 2007, 5:47:37 PM12/23/07
to diso-p...@googlegroups.com
> and there is also one worst case: If someone wants to post a comment
> and wants to fill out the form hisself. He uses a url to a weblog
> where he posted an hcard (not his profile). if he submits the comment,
> the plugin detects the hcard and replaces his data with the hcard he
> has posted on his weblog.

So only fill in automatically if they /didn't/ fill in the form themselves :)

Pfefferle

unread,
Dec 23, 2007, 5:53:19 PM12/23/07
to DiSo Project
do you think it is really the better way? any other opinions?

Stephen Paul Weber

unread,
Dec 23, 2007, 6:02:05 PM12/23/07
to diso-p...@googlegroups.com
I think having both as features makes sense -- the link AND the
autofill. Have an admin panel where you can turn either on and off or
something :) Just my 2c

--

- Stephen Paul Weber, Amateur Writer
<http://www.awriterz.org>

MSN/GTalk/Jabber: singp...@gmail.com

Chris Messina

unread,
Dec 24, 2007, 2:37:43 PM12/24/07
to diso-p...@googlegroups.com, Drew Mclellan
Perhaps Drew can fix this bug in hKit?

Chris

Sent from my iPhone

Reply all
Reply to author
Forward
0 new messages