Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So it would be nice if one could type in your Drupal.org username, and we fetched your UID. I'm not sure if there's a webservice for this on d.o, I would suspect not.
This would also allow things like auto-completion of the username just like certifiedtorock.com.
Big question is: What's the easiest way to get an array of user IDs from user names?
Comments
Comment #1
tim.plunkettI know http://dgo.to has the ability to resolve usernames to UIDs.
http://dgo.to/@Steven%20Jones
http://dgo.to/@tim.plunkett
Not sure how it works, or who even runs that, so that may not be at all helpful information :)
EDIT
On a whim, I tried 'wget http://dgo.to/@Steven%20Jones' and it downloaded the file as '99644'.
That's gotta be useful somehow!
Comment #2
gregglesWe've been thinking of providing this on certifiedtorock as well as a lookup that returns a list of uids and names. If we do end up doing it I'll try to remember to comment here.
Thanks for making this module! Now, to include a badge as a dispaly option :)
Comment #3
Josh The Geek CreditAttribution: Josh The Geek commentedcurl -I http://dgo.to/@Dries 2> /dev/null | grep Location: | cut -d ' ' -f 2- | cut -d / -f 5
== 1, his d.o uid.Comment #4
Steven Jones CreditAttribution: Steven Jones commentedOr in Drupal land:
Comment #5
tim.plunkettSo should we allow users to type in their name, and perform this on validate?
Comment #6
Steven Jones CreditAttribution: Steven Jones commentedNot sure what the best UX would be here, but something along those lines for sure.
Comment #7
Steven Jones CreditAttribution: Steven Jones commentedSo we only have an int column stored against the field, so we can't go storing the username entered sadly, but we could still allow input of usernames instead of UIDs and then just transform on validate.
Comment #8
Steven Jones CreditAttribution: Steven Jones commentedI've added this to the 7.x branch, http://drupalcode.org/project/ctr_field.git/commit/8b1ba26e190c04836d95a...
Tim, do you want to see if you can add this to the 6.x branch too? It should mostly just directly port, apart from the use of
drupal_array_get_nested_value()
Comment #9
tim.plunkettI haven't had the time for this, sorry.
Comment #10
gregglesIn case it's a little more reliable, there's now http://certifiedtorock.com/person_uid.json/tim.pl